ANSI C -- reserved words

Martin Minow minow at decvax.UUCP
Mon Dec 15 02:15:46 AEST 1986


This is one of a collection of comments on the Draft Standard, posted to
comp.lang.c for discussion before I mail a final draft to the Ansi C
committee.  Each message discusses one problem I have found with the Draft
Standard that I feel warrants a "no" vote.  Note that this message is my
personal opinion, and does not reflect on the opinions of my employer.

---- Problem:

Page 13, line 10ff (and many other places). The values defined in
<limits.h> should be written with a leading underscore, so they do not
occupy the name space reserved to user programs. The Standard should not
create new quasi-reserved words that occupy the name space reserved to
user programs.

---- Motivation:

Page 13, line 10ff (and many other places). As discussed in section 4
(page 84, line 26), all identifiers and macro names that begin with an
underscore are reserved to the implementation.  The Standard has also
defined several hundred macros, typedefs, and symbolic constants with
initial alphabetic characters.  This results in a situation where the
programmer cannot easily define variables that are guaranteed never to
conflict with implementation reserved words.  Except for those few reserved
words in current common usage (such as NULL), all implementation defined
macros and data types should be defined with an initial underscore. This will
offer a clear indication to the programmer that an implementation specific
value or function is being used.  It will also guarantee that future
standards can define additional macros without breaking existing programs.

----

Martin Minow
decvax!minow



More information about the Comp.lang.c mailing list