__STDC__ and non-conforming ANSI C compilers

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Jan 20 00:22:23 AEST 1989


In article <2797 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>By the by, some people are claiming that putting '-DFOO' on the command
>line makes the compiler non-conforming. Doesn't that make __STDC__
>pretty useless? Have you looked at the news sources, lately?

I think I was the one who first advanced that argument; however I
now think that it isn't necessary to enforce that.  It all depends
on whether you consider such an invocation of the compiler to make
the IMPLEMENTATION or the APPLICATION the definer of the symbol.
Technically by the ANSI C spec there is no alternative but to
consider this a definition by the implementation.  However, if
"cc -c -DFOO source.c" is viewed as a convenient abbreviation for
essentially
	echo '0a/#define FOO 1\n/\nw\nq' | sam -d source.c
	cc -c source.c
	echo '1d' | sam -d source.c
then it could be claimed to be an application definition.  That's
kind of cheating, but it's an undoubted convenience so it would be
reasonable to take that approach.

>> X3J11 decided not to authorize official "levels" of conformance
>> to the Standard;
>I suspect this is a mistake.

I don't think so.  Languages that HAVE had "levels" have shown that
having them is a mistake.



More information about the Comp.std.c mailing list