MESSAGE
DATE | 2011-06-11 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: Using sizeof in the preprocessor
|
-- forwarded message -- Path: reader1.panix.com!panix!bloom-beacon.mit.edu!micro-heart-of-gold.mit.edu!nntp.club.cc.cmu.edu!feeder.erje.net!feeder.news-service.com!2a02:590:1:1::196.MISMATCH!news.teledata-fn.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" From: Johannes Schaub Reply-To: schaub.johannes-at-googlemail.com Date: Sat, 21 May 2011 21:54:20 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Using sizeof in the preprocessor Newsgroups: comp.lang.c++ References: <4dd7bfa5$0$7624$9b4e6d93-at-newsspool1.arcor-online.net> <4dd809a7$0$2844$7b1e8fa0-at-news.nbl.fi> Followup-To: comp.lang.c++ MIME-Version: 1.0 Lines: 17 Message-ID: <4dd81857$0$6541$9b4e6d93-at-newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 21 May 2011 21:53:59 CEST NNTP-Posting-Host: 2f91366a.newsspool4.arcor-online.net X-Trace: DXC=BYHb>TS2ZFeEB;5>eE0T7m4IUKRM4XCem1:ZIQbMX-Complaints-To: usenet-abuse-at-arcor.de Xref: panix comp.lang.c++:1085128
Juha Nieminen wrote:
> Huibert Bol wrote: >> Identifiers in #if expressions are evaluated as zero > > It seems that at least with gcc "#if true" and "#if false" work as one > would expect. Is this standard?
There are explicit exceptions for true and false. The spec says
After all replacements due to macro expansion and the defined unary operator have been performed, all remaining identiï¬ers and keywords, except for true and false, are replaced with the pp-number 0, and then each preprocessing token is converted into a token. The resulting tokens comprise the controlling constant expression which is evaluated according to the rules of 5.19 ...
-- end of forwarded message --
|
|