ANSI C -- preprocessing

Martin Minow minow at decvax.UUCP
Mon Dec 15 02:15:59 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 75, line 27.  An identifier not currently defined as a macro should
produce a diagnostic message.  Whether or not the diagnostic is fatal
should be implementation defined.

Page 75, line 32ff.  The result of preprocessing character constants should
be the same as the result of executing the equivalent statements.  A single
character constant shall have a negative value if it would have a negative
value according to the semantics for character constants given on page 25,
line 35.

Page 82, line 10ff.  An unrecognized #pragma should result in a diagnostic
message.


---- Motivation:

Page 75, line 27.  An identifier not currently defined as a macro should
produce a diagnostic message.  The "defined()" preprocessing expression
may be used to check for definition:

    #if (defined(foo) ? foo : 0) == 123

The standard should not encourage ``silent'' programming errors in the
preprocessor, when it forbids use of an undeclared variable in the language
proper.

----

Martin Minow
decvax!minow



More information about the Comp.lang.c mailing list