__STDC__ and non-conforming ANSI C compilers

Scott Garfinkle seg at smsdpg.uu.net
Sat Jan 14 05:44:25 AEST 1989


>From article <898 at ubu.warwick.UUCP>, by geoff at uk.ac.warwick.emerald (Geoff Rimmer):
> I think I read in the Microsoft 5.1 C compiler manual that __STDC__ is
> defined to be 0 in that compiler, since it doesn't fully comply to the ANSI
> standard.  If this is so, it makes lines like the following, useless.
> 
> #ifdef __STDC__
> ...
> #else
> ...
> #endif
No, it doesn't make this "useless."  In fact, your example (shortened here)
works just fine.  You just can't say "#if __STDC_", you have to use #ifdef
(or "#if defined()").

> Anyone know of any other compilers that don't comply with the correct use of
> the __STDC__ macro? ...
According to the AT&T SysV R4.0 (SVR4) Developers' Conference presentation, the
SVR4 compiler will, however, be "useless" in the sense above; the MSC compiler
defines __STDC__ to 0 because there are some differences and not-fully-
implented things (c.f. my recent complaint about (int * const) objects) in MSC5.
In SVR4 cc, it *always* defines __STDC__, but sets it to 0 if you tell it you
want "old-style C."  Kind of strange, I thought.  (Maybe I misunderstood them.)
		Scott E. Garfinkle
		SMS Data Products Group, Inc.
		uunet!smsdpg!seg

		<standard disclaimer>



More information about the Comp.std.c mailing list