MSC __STDC__ strange value

Henry Spencer henry at utzoo.uucp
Wed Dec 6 03:43:18 AEST 1989


In article <223 at bohra.cpg.oz> ejp at bohra.cpg.oz (Esmond Pitt) writes:
>For some strange reason, the MSC 5.1 compiler defines __STDC__ as 0, so
>
>#if __STDC__
>...
>#endif
>
>yields a different result from
>
>#ifdef __STDC__
>...
>#endif
>
>Why?

Are you asking why the results are different, or why __STDC__ is defined
oddly?  If the former, __STDC__ is defined but 0, which means that #ifdef
says "yes" but #if says "no".  If the latter, consider the possibility
that Microsoft is being stupid (heaven knows there is plenty of evidence
for this in other areas...).

Actually, one can weakly defend defining __STDC__ as 0 for a compiler
which conforms to ANSI C in every way except for name-space pollution.
Microsoft probably hasn't been smart enough to get that right, though.
-- 
Mars can wait:  we've barely   |     Henry Spencer at U of Toronto Zoology
started exploring the Moon.    | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list