__STDC__ and non-conforming ANSI C compilers

John F. Haugh II jfh at rpp386.Dallas.TX.US
Wed Jan 18 15:16:05 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?

I really find this to be a highly bogus argument.  There should be
no difference between 'cc -DFOO ...' and adding a '#define FOO' at the
very first line.

Remember that it is the USER who polluted the namespace.  Every variable
or macro definition in a program is 'namespace pollution'.  I would
argue that the important difference is that the user selected the option
to add the definition for FOO.  Adding new reserved words, such as
'near' or 'far' or 'fortran' is different.  Those aren't exceptions.
-- 
John F. Haugh II                        +-Quote of the Week:-------------------
VoiceNet: (214) 250-3311   Data: -6272  |"UNIX doesn't have bugs,
InterNet: jfh at rpp386.Dallas.TX.US       |         UNIX is a bug."
UucpNet : <backbone>!killer!rpp386!jfh  +--------------------------------------



More information about the Comp.std.c mailing list