Some questions about POSIX headers
Bob Goudreau
goudreau at dg-rtp.dg.com
Wed Nov 15 07:13:23 AEST 1989
In article <6622 at portia.Stanford.EDU> karish at forel.stanford.edu (Chuck Karish) writes:
>
> Under ANSI C, _LOW, _HIGH, __s, and __v are all reserved to the
> library implementor if they're external identifiers, because they
> all start with underscores. In any standard header, they'll
> become externals when the header is #included with external scope.
>
> The question now becomes, is the header part of the library
> implementation or not? If any compiler other than the native one
> will use these headers, the answer had best be `not'.
>
> These identifiers are OK with file scope or smaller inside a C
> library implementation, but not as external identifiers.
Here's what the Dec. 7, 1988 ANSI draft says about the matter:
4.1.2.1 Reserved Identifiers
Each header declares or defines all identifiers listed in its
associated section, and optionally declares or defines
identifiers listed in its associated future library directions
section and identifiers which are always reserved either for
any use or for use as file scope identifiers.
+ All identifiers that begin with an underscore and either an
upper-case letter or another underscore are always reserved
for any use.
+ All identifiers that begin with an underscore are always
reserved for use as identifiers with file scope in both the
ordinary identifier and tag name spaces.
....
Since _LOW, _HIGH, __s and __v all fall into the first category ("always
reserved for any use"), the implementation is free to do what it wants
with them. But note that if _s had been used instead of __s, only the
second category would have applied.
------------------------------
Bob Goudreau +1 919 248 6231
Data General Corporation ...!mcnc!rti!xyzzy!goudreau
62 Alexander Drive goudreau at dg-rtp.dg.com
Research Triangle Park, NC 27709, USA
More information about the Comp.lang.c
mailing list