__STDC__ and non-conforming ANSI C compilers

Colin Plumb w-colinp at microsoft.UUCP
Sat Jan 21 14:02:50 AEST 1989


peter at ficc.uu.net (Peter da Silva) wrote:
> If you really want to survive __STDC__==0, then here's a workable solution...

> This will mean you will always have __STDC__ defined as 0 or 1.

No, no, no... the argument (and I'm starting to see the opposition's
points) is that *almost* ANSI-compliant compilers (i.e. ones that
accept all the ANSI C syntax features, but may have polluted namespaces),
should #define __STDC__ 0.  K&R compilers should not define it at all.

Basically, this tells you the compiler won't barf on prototypes or
forward struct references or const or volatile or unary + or ...
or # and ## or defined() or any such ANSIism.  You still have to worry
about finding the right headers and strrchr and all the library mess
that currently exists.  The compiler comes halfway.
-- 
	-Colin (uunet!microsof!w-colinp)



More information about the Comp.std.c mailing list