Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.std.c Subject: Re: Want the word on __STDC__ Message-ID: Date: 7 Mar 91 18:55:37 GMT References: <4203@lupine.NCD.COM> <15381@smoke.brl.mil> <668288453.3046@mindcraft.com> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 28 fred@mindcraft.com (Fred Zlotnick) writes: >... since we know that >nonconforming implementations do in fact sometimes define __STDC__ to >something other than 1, it would be useful to protect your code by using >the test > #if __STDC__ == 1 >rather than > #ifdef __STDC__ There are problems with that, though, quite apart from otherwise conforming hypothetical implementations that define __STDC__ to be other than 1. The replacement of undefined identifiers by 0 may have been a de facto Unix standard but it was nowhere mentioned in K&R1 so it would have been reasonable for a pre-standard implementation to make it an error for a #if to contain an undefined identifier. If I want my code to run on pre-standard implementations (which presumably I do if I care about __STDC__) then I am reluctant to depend on #if __STDC__ or #if __STDC__ == 1 rather than #ifdef __STDC__ which would have been safe had it not been for cretinous implementors who made half-standard implementations with __STDC__ defined but 0. , Eamonn