Discussion:
DJGPP v2.05: some thoughts
(too old to reply)
Nick Bowler
2015-06-05 20:19:57 UTC
Permalink
Raw Message
[cross-posting this to comp.std.c for comments]
Names starting with E followed by a digit or an uppercase letter are
reserved if <errno.h> is included.
I don't see this text in the standard.
It was not a quote from the standard.
Additional macro definitions, beginning with E and a digit or E and
an uppercase letter, may also be specified by the implementation.
This text was copied unchanged into C11. I am quite sure it was also
present in C89.
It's indeed present in C89, but I don't see how it reserves these
names.
It's reserved for the implementation (DJGPP in this case) because this
text occurs in a library subclause. You need to go back to the section
on reserved identifiers. In particular:

C99§7.1.3p1 Reseverd Identifiers

... Each macro name in any of the following subclauses (including
the future library directions) is reserved for use as specified
if any of its associated headers is included; unless explicitly
stated otherwise (see 7.1.4).

This text is also unchanged in C11.
Hans-Bernhard Bröker
2015-06-05 21:12:58 UTC
Permalink
Raw Message
Post by Nick Bowler
[cross-posting this to comp.std.c for comments]
[But forgot to implement a F'up2....]
Post by Nick Bowler
Additional macro definitions, beginning with E and a digit or E and
an uppercase letter, may also be specified by the implementation.
It's indeed present in C89, but I don't see how it reserves these
names.
It's reserved for the implementation (DJGPP in this case) because this
text occurs in a library subclause.
No, it's not. It says an implementation *may* _define_ additional
identifiers, but that doesn't _reserve_ those identifiers.
Post by Nick Bowler
You need to go back to the section
C99§7.1.3p1 Reseverd Identifiers
... Each macro name in any of the following subclauses (including
the future library directions) is reserved for use as specified
if any of its associated headers is included; unless explicitly
stated otherwise (see 7.1.4).
This text is also unchanged in C11.
And it doesn't apply to the issue at hand, because none of the
non-standard errno macros is actually _in_ any of the Library subclauses.
James Kuyper
2015-06-05 22:21:29 UTC
Permalink
Raw Message
Post by Hans-Bernhard Bröker
Post by Nick Bowler
[cross-posting this to comp.std.c for comments]
[But forgot to implement a F'up2....]
Post by Nick Bowler
Additional macro definitions, beginning with E and a digit or E and
an uppercase letter, may also be specified by the implementation.
It's indeed present in C89, but I don't see how it reserves these
names.
It's reserved for the implementation (DJGPP in this case) because this
text occurs in a library subclause.
No, it's not. It says an implementation *may* _define_ additional
identifiers, but that doesn't _reserve_ those identifiers.
Post by Nick Bowler
You need to go back to the section
C99§7.1.3p1 Reseverd Identifiers
... Each macro name in any of the following subclauses (including
the future library directions) is reserved for use as specified
if any of its associated headers is included; unless explicitly
stated otherwise (see 7.1.4).
This text is also unchanged in C11.
And it doesn't apply to the issue at hand, because none of the
non-standard errno macros is actually _in_ any of the Library subclauses.
It seems pretty clear to me that 7.1.3p1 applies to names described by
rules specified in a given clause (such as the rule given in 7.5p4), and
not just to names that are explicitly listed in those clauses.

If that weren't the case, the cross-reference to "future library
directions" (7.31), could have been made far more specific. The only
names actually listed in 7.31. are in 7.31.1; all of the other names
described in other 16 sub-sections are given only by rules, not explicit
lists. For that matter, 2/3 of the names described by 7.31.1 itself are
described by rules, rather than being explicitly listed.

Note that 7.31p1 says " All external names described below are reserved
...". Even if it might seem ambiguous whether "in" applies to names
described by rules, it seems quite clear to me that "described" does.
"Function names that begin with either is or to, and a lowercase letter
..." (7.31.2) definitely does describe "isa()", regardless of whether
you agree that "isa" is actually "in" 7.31.2. However, if you insist
that "in" does not apply to such names, this means that the external
names described by rules given in 7.31 are reserved because of 7.31p1,
but that the macros described by rules given in 7.31 are not, because of
the different wording fo 7.1.3p1. That strikes me as odd, and unlikely
to be the intended interpretation.

In my opinion, that part of 7.31p1 is merely a restatement of the
corresponding part of 7.1.3p1, using the phrase "described below" rather
than "in" doesn't make any identifiers reserved that would not have
already been reserved because of 7.1.3p1.
Martin Str|mberg
2015-06-06 07:52:37 UTC
Permalink
Raw Message
Post by Hans-Bernhard Bröker
Post by Nick Bowler
[cross-posting this to comp.std.c for comments]
It's reserved for the implementation (DJGPP in this case) because this
text occurs in a library subclause.
No, it's not. It says an implementation *may* _define_ additional
identifiers, but that doesn't _reserve_ those identifiers.
They may not be reserved (in Standardese), but as a user you can't
count on that there is not an "E[0-9A-Z]*", thus effectively making
them reserved (in English).


Anyway the other sections (7.1.3 and 7.26.3) of the standard does
reserve them (for DJGPP) IMO.
--
MartinS
Loading...