🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4347

Re: defined(FOO) in macros

#4347
From: Tanmoy Bhattacharya
Date: Sat, 11 Nov 1995 04:56
27 lines
1297 bytes
In article <48190c$bak@nyx10.cs.du.edu>, colin@nyx10.cs.du.edu (Colin Plumb) writes:
|> I noticed that a DEC's Alpha compiler breaks on 
|> 
|> host% cat > foo.f <<EOF
|> #ifndef HAVE_FOO
|> #define HAVE_FOO defined(FOO)
|> #endif
|> 
|> #if HAVE_FOO
|> #error No, we have FOO
|> #else
|> #error Yes, we have no FOO
|> #endif
<snip>
|> Now, the second two diagnostics are fine, but is the compiler allowed to
|> not recognize "defined(FOO)" when it appears as part of a macro expansion?

Yes. see 6.8.1

Cheers
Tanmoy
---
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
Technical Details
Message-ID: <481adm$q4v@newshost.lanl.gov>
Path: arc1-ca.pugleaf.net!qcd.lanl.gov!tanmoy
References: <48190c$bak@nyx10.cs.du.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!qcd.lanl.gov!tanmoy
From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
Newsgroups: comp.std.c
Subject: Re: defined(FOO) in macros
Date: 11 Nov 1995 04:56:22 GMT
Organization: Los Alamos National Laboratory
Distribution: world
Message-ID: <481adm$q4v@newshost.lanl.gov>
References: <48190c$bak@nyx10.cs.du.edu>
NNTP-Posting-Host: qcd.lanl.gov