Re: [PATCH 1/6] CodingGuidelines: describe "export VAR=VAL" rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Schwab <schwab@xxxxxxxxxxxxxx> writes:

>> I suspect you meant:
>>
>>    ... and suggest us to instead write it as "VAR=VAL" followed by
>>    "export VAR".
>
> There is no difference between them.  The export command only marks the
> variable for export, independent of the current or future value of the
> variable.  The exported value is always the last assigned one.

Correct.

But we are talking about working around sub-standard (read: buggy)
implementations and it is of dubious value to assume a compliant
implementation when devising a workaround.

It is easily imaginable that a sub-standard implementation uses a
symbol table with a single "is it exported?" bit in addition to
(name, value), without a way to say "this parameter is not set
(yet)" (IOW, never value==NULL), and such an implementation would
not be capable to have "this name is exported but nobody set the
value to it yet".  Using an assignment to make sure it is known
before setting the exported bit is safer to protect against such an
implementation.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux