Path: utzoo!attcan!uunet!smsdpg!seg From: seg@smsdpg.uu.net (Scott Garfinkle) Newsgroups: comp.std.c Subject: Re: __STDC__ and non-conforming ANSI C compilers Message-ID: <179@smsdpg.uu.net> Date: 13 Jan 89 19:44:25 GMT References: <898@ubu.warwick.UUCP> Organization: SMS Data Products Group, Reston VA Lines: 27 From article <898@ubu.warwick.UUCP>, by geoff@uk.ac.warwick.emerald (Geoff Rimmer): > I think I read in the Microsoft 5.1 C compiler manual that __STDC__ is > defined to be 0 in that compiler, since it doesn't fully comply to the ANSI > standard. If this is so, it makes lines like the following, useless. > > #ifdef __STDC__ > ... > #else > ... > #endif No, it doesn't make this "useless." In fact, your example (shortened here) works just fine. You just can't say "#if __STDC_", you have to use #ifdef (or "#if defined()"). > Anyone know of any other compilers that don't comply with the correct use of > the __STDC__ macro? ... According to the AT&T SysV R4.0 (SVR4) Developers' Conference presentation, the SVR4 compiler will, however, be "useless" in the sense above; the MSC compiler defines __STDC__ to 0 because there are some differences and not-fully- implented things (c.f. my recent complaint about (int * const) objects) in MSC5. In SVR4 cc, it *always* defines __STDC__, but sets it to 0 if you tell it you want "old-style C." Kind of strange, I thought. (Maybe I misunderstood them.) Scott E. Garfinkle SMS Data Products Group, Inc. uunet!smsdpg!seg