__STDC__ and non-conforming ANSI C compilers

Jim Gardner jagardner at watmath.waterloo.edu
Thu Jan 19 17:39:41 AEST 1989


In article <8742 at megaron.arizona.edu> mike at arizona.edu (Mike Coffin) writes:
:From article <358 at masscomp.UUCP>, by ftw at masscomp.UUCP (Farrell Woods):
:> If I invoke a conforming compiler with "cc -DFOO", but my program
:> has #ifdef __STDC__ in it, how does this break conformance?
:
:If "cc -DFOO" has the effect of providing of predefining FOO, then it
:does not provide a conforming compilation environment: the program's
:name space has been polluted.  So I assume that __STDC__ will not be
:defined in such cases.  Do you think this should be an exception?  If
:so, do you have any other exceptions in mind?

You're viewing the -DFOO as changing the compiler. Alternatively, you can
view it as an option that specifies the C source input, inserting a
"#define FOO" and "#line 1" lines before the first line of the
"source file". The translation environment is not changed, but the input 
source is specified in a peculiar way.



More information about the Comp.std.c mailing list