Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!microsoft!w-colinp From: w-colinp@microsoft.UUCP (Colin Plumb) Newsgroups: comp.std.c Subject: Re: __STDC__ and non-conforming ANSI C compilers Message-ID: <274@microsoft.UUCP> Date: 16 Jan 89 00:08:46 GMT References: <898@ubu.warwick.UUCP> <264@microsoft.UUCP> <9371@smoke.BRL.MIL> Reply-To: w-colinp@microsoft.uucp (Colin Plumb) Organization: very little Lines: 19 gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) wrote: > I maintain that predefining __STDC__ is a mistake, except when the > implementation conforms to the Standard (in which case __STDC__ is > necessarily preset to 1, for the current standard, or some number > greater than 1, presumably, for a future compatible standard). > There is no way you can know what use a programmer is making of > __STDC__. In fact your guess was wrong for some of the code we > have.. True, but if the programmer is really exercising the ANSI C standard, they'll know about the __STDC__ == 1 (#if __STDC__ is shorter, anyway!) and won't get caught. But if, as is very popular, they use ##ifdef __STDC__ as a switch to tell whether to use ANSI cpp-isms or Reiser tricks for token-pasting, or whether they can include prototypes, or use void *, etc., it'll work. It seems like a reasonable convention to me. -- -Colin (uunet!microsof!w-colinp)