Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: "christian.bau" Newsgroups: comp.compilers Subject: Re: C arcana, was type or identifier fundamental parsing issue - Need help from parsing experts Date: Thu, 12 Jul 2012 09:23:39 -0700 (PDT) Organization: Compilers Central Lines: 18 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-07-013@comp.compilers> References: <12-07-004@comp.compilers> <12-07-007@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: leila.iecc.com 1342129876 35266 64.57.183.58 (12 Jul 2012 21:51:16 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 12 Jul 2012 21:51:16 +0000 (UTC) Keywords: C, standards Posted-Date: 12 Jul 2012 17:51:16 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:713 On Jul 4, 11:43 am, Hans-Peter Diettrich wrote: > There exist pros and cons. The C preprocessor *requires* that sizeof > is a built-in *macro*, so that it can be used in #if conditions. Ahem... No, it doesn't. Unless you do something really perverse like #define sizeof sizeof will not be defined as a macro, and any non-macro identifier used within #if other than as an operand to "defined" will be replaced by 0. [After squinting at the various C standards and checking with committee members, I found that the C preprocessor does not know about any keywords at all, so it treats sizeof and int as ordinary names. This allows occasionaly useful kludges like #define short int -John]