🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2526

Re: Want the word on __STDC__

#2526
From: Rahul Dhesi
Date: Thu, 07 Mar 1991 02:23
26 lines
1592 bytes
In <668288453.3046@mindcraft.com> fred@mindcraft.com (Fred Zlotnick) 
recommends the test

>  #if __STDC__ == 1

to detect nonconforming implementations.  Unfortunately there are
two problems with this.

First, it is quite possible that a future ANSI C standard will bump up
the value of __STDC__ to 2, thus breaking code that assumes that
(__STDC__ != 1) implies (not standard C).

Second, some existing nonconforming implementations of C will
fail to compile expressions like

   #if something == something.

Now you may say these implementations aren't C, and you might be right,
but they are *called* C by many users, and they will be upset that
ostensibly portable C code won't compile.  Truly defensive programmers
assume that the preprocessor does not understand C expressions.  Such
flaky implementations are fortunately dying out, but I could easily
ruffle through my old disks and find a few that aren't quite dead yet.
--
Rahul Dhesi <dhesi%cirrusl@oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi
Technical Details
Message-ID: <2986@cirrusl.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!olivea!tymix!cirrusl!ss168!dhesi
References: <4755@lib.tmc.edu> <15260@smoke.brl.mil> <4203@lupine.NCD.COM> <15381@smoke.brl.mil> <668288453.3046@mindcraft.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!olivea!tymix!cirrusl!ss168!dhesi
From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi)
Newsgroups: comp.std.c
Subject: Re: Want the word on __STDC__
Message-ID: <2986@cirrusl.UUCP>
Date: 7 Mar 91 02:23:33 GMT
References: <4755@lib.tmc.edu> <15260@smoke.brl.mil> <4203@lupine.NCD.COM> <15381@smoke.brl.mil> <668288453.3046@mindcraft.com>
Sender: news@cirrusl.UUCP
Organization: Cirrus Logic Inc.
Lines: 26