home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!att!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: How to handle __STDC__
- Keywords: ANSI C, prototypes
- Message-ID: <1992Aug30.163757.24804@organpipe.uug.arizona.edu>
- Date: 30 Aug 92 16:37:57 GMT
- References: <393@bsovax.UUCP> <hawkeye.715165677@glia>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 34
- In-Reply-To: hawkeye@glia.biostr.washington.edu (Ken Keys - TF Dude)
-
- In article <hawkeye.715165677@glia>, hawkeye@glia (Ken Keys - TF Dude) writes:
- [question deleted]
- >The ANSI/ISO standard does say that __STDC__ must be defined as 1 in
- >any standard-conforming compiler.
-
- The obvious conclusion is that the right way to check if you are compiling
- under a standard-conforming compiler is to use "#if __STDC__".
-
- >However, since a non-standard
- >compiler is, by definition, not bound by the standard, it can do
- >whatever it wants, including defining __STDC__ as 1.
-
- Well, if you want to worry about this, you could do this:
-
- /* If this breaks because your non-standard compiler */
- /* #define's __STDC__ to 1, complain to you vendor, */
- /* and not to the author of the code. */
- #if __STDC__
-
- . . .
-
- >I agree, however,
- >defining __STDC__ as 0 was a bad choice on the part of Mark Willams,
-
- Agreed (assuming ANSI gave no meaning to "#define __STDC__ 0").
-
- >a lot of existing code does use the "#ifdef __STDC__" check.
-
- Well, as I indicated above, my reading of the quote you gave is that
- "#if __STDC__" is clearly the right choice for checking for a compliant
- compiler. Using "#ifdef __STDC__" is IMHO sloppy work.
-
- --
- Dave Schaumann dave@cs.arizona.edu
-