Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.std.c Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers Keywords: ANSI C, __STDC__ Message-ID: <721@auspex.UUCP> Date: 15 Dec 88 18:54:29 GMT References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 28 >__STDC__ is intended to indicate standard conformance, and nothing else, >certainly not "sort of conforming but different in ways I >think you might like, sorry if it breaks your code". I'll certainly agree with that for >Please don't define __STDC__ at all for non standard- >conforming implementations, even if they provide a lot of >so-called "ANSI C" features. There have been reports of a compiler that defines __STDC__ even though it provides *some*, but not all, ANSI C features; the authors of that compiler should be horsewhipped. However, what about a compiler that can be run in at least two modes, one of which is "strict tight-sphincter ANSI C", meaning "no, there are NO macros declared, or objects defined, that aren't listed by name in the ANS, and there are NO other extensions permitted either", and one of which is "ANSI C plus extensions", e.g. "we define some things in #include files that may pollute the namespace"? For instance, consider a program written for a POSIX environment, so that it might not compile in "strict ANSI C" mode, but written so that it can use function prototypes if they're present? Should __STDC__ be defined by the compiler running in "ANSI C plus extensions" mode, so that the code can use "__STDC__" to determine whether function prototypes, or "#" and "##", or... are supported?