Mark Williams C

T. William Wells bill at twwells.uucp
Sun May 28 04:40:19 AEST 1989


In article <13475 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
: But not nearly as reasonable as undefining it completely, which would work
: with *both* "#if" and "#ifdef", and which would be consistent with all the
: compilers that were written before X3J11 invented the __STDC__ symbol.

The ANSI standard applies only to implementations and programs
claiming conformance to it. Who should care what others do? If you
are writing programs that have to check the implementation for
conformance, you had just better only check for __STD__ == 1.
Anything else is just damn lazyness on your part.

If you are writing code that has to deal with preprocessors that will
complain about #if __STDC__ == 1 when __STDC__ is undefined, add this
to the top of your code:

	#ifndef __STDC__
	#define __STDC__ 0
	#endif

Then wherever you need to test for ANSI conformance, you can just
test for __STDC__ == 1 without worrying about __STDC__ being
undefined at that point.

---
Bill                            { uunet | novavax } !twwells!bill



More information about the Comp.std.c mailing list