🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #959

Re: #if's and !

#959
From: Stacey Campbell
Date: Thu, 28 May 1992 17:16
39 lines
2217 bytes
In article <gnusenet674@bibsyst.UUCP> tore@bibsyst.no (Tore Morkemo) writes:
>It seems that SCO's cc and gcc can't agree on preprocesing. We're running
>SCO 3.2.4 and devsys for 3.2.4. I'm not sure but I think the bug/feature
>showed up in 3.2.4

What you are seeing is the difference between manifest defines on SCO cc and
gcc.  Gcc has correctly defined __STDC__ to be 1, and SCO cc has defined
__STDC__ to be 0.  If having __STDC__ defined as 1 is causing you grief
in /usr/include header files when compiling with gcc, then I would recommend
either overriding the value of __STDC__ at compile time with -D__STDC__=0
(which will produce warnings on gcc 1.40), or altering the manifest define
in your gcc source tree.  I certainly wouldn't recommend that you attempt
to modify your /usr/include header files.

>Here's the testprogram.....
>;cat prep.c
>#ifdef __STDC__
>STDC it is...
>#endif

The equivalent "not #if" preprocessor check to the above is;

#if ! defined(__STDC__)

In the case;

>#if !__STDC__

you are checking the value of __STDC__, and not necessarily whether
it is defined.  If it is not defined at all then the symbol will have
a "value" of 0.

[I've removed comp.std.c since this isn't relevant to a general standards
discussion, and comp.lang.c since this is an implementation specific thing
that doesn't seem to be welcome there (plus talking about defining __STDC__
as 0 always seems to attract flames over there for some reason :-).]
-- 
     Stacey Campbell - staceyc@sco.com - {uunet,ucscc,att}!sco!staceyc
Technical Details
Message-ID: <1992May28.171640.12777@sco.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!uunet!scorn!staceyc
References: <gnusenet674@bibsyst.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,602cd848de9933fc
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1122ea,697b80ebb490c20b
X-Google-Attributes: gid1122ea,public
X-Google-ArrivalTime: 1992-05-28 10:35:20 PST
Newsgroups: gnu.gcc.help,biz.sco.general
Path: arc1-ca.pugleaf.net!sparky!uunet!uunet!scorn!staceyc
From: staceyc@sco.COM (Stacey Campbell)
Subject: Re: #if's and !
Organization: The Santa Cruz Operation, Inc.
Date: Thu, 28 May 1992 17:16:40 GMT
Message-ID: <1992May28.171640.12777@sco.com>
Keywords: SCO cc gcc cpp
References: <gnusenet674@bibsyst.UUCP>
Sender: news@sco.com (News admin)
Lines: 39