home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!math.fu-berlin.de!Sirius.dfn.de!darwin.sura.net!wupost!usc!rpi!uwm.edu!ogicse!news.u.washington.edu!glia!hawkeye
- From: hawkeye@glia.biostr.washington.edu (Ken Keys - TF Dude)
- Newsgroups: comp.lang.c
- Subject: Re: How to handle __STDC__
- Keywords: ANSI C, prototypes
- Message-ID: <hawkeye.715165677@glia>
- Date: 30 Aug 92 09:07:57 GMT
- Article-I.D.: glia.hawkeye.715165677
- References: <393@bsovax.UUCP>
- Sender: news@u.washington.edu (USENET News System)
- Organization: University of Washington
- Lines: 37
-
- In <393@bsovax.UUCP> albert@bsovax.UUCP (Albert van der Horst) writes:
-
- >C) concerning __STDC__
- >This built in #define is used most often to govern the use of
- >prototypes.
-
- >K&C II says about __STDC__ :
- >" __STDC__ may only be one if the C-system is ANSI standard"
- >or some such.
-
- >This would imply that you can have "#define __STDC__ 2"
- >on a non standard system. Mark Williams is doing something
- >substantially more reasonable : "#define __STDC__ 0" to convey that
- >its c-compiler is not standard.
-
- >The result is that I cannot compile programs that use
- >"#ifdef __STDC__". However this seems common practice in sources
- >distributed via the net, but I have seen "#if __STDC__" as well.
-
- >Can someone with access to (and understanding of!) the official
- >standard please give an authoritive answer to this?
-
- The ANSI/ISO standard does say that __STDC__ must be defined as 1 in
- any standard-conforming compiler. 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. I agree, however,
- defining __STDC__ as 0 was a bad choice on the part of Mark Willams,
- since a lot of existing code does use the "#ifdef __STDC__" check. My
- only suggestion is to use "#if __STDC__" in your own code, and hope
- no vendor is stupid enough to #define __STDC__ 1 in a non-standard
- compiler.
-
- --
- --
- Ken Keys, aka Hawkeye
- Master of the Fugue
- kkeys@ucsd.edu or hawkeye@ucsd.edu
-