Related articles |
---|
type or identifier fundamental parsing issue - Need help from parsing hsad005@gmail.com (AD) (2012-07-03) |
Re: type or identifier fundamental parsing issue - Need help from pars DrDiettrich1@aol.com (Hans-Peter Diettrich) (2012-07-04) |
Re: C arcana, was type or identifier fundamental parsing issue - Need christian.bau@cbau.wanadoo.co.uk (christian.bau) (2012-07-12) |
DKIM-Signature: | v=1; a=rsa-sha256; c=simple; d=iecc.com; h=cc:from:subject:date:sender:message-id:references:mime-version:content-type:content-transfer-encoding:vbr-info; s=89cc.4fff46d5.k1207; i=johnl@user.iecc.com; bh=R/yeKJgWuAHWO4jDjCoiOlOupMnq9c5Z0sArfoaVSWM=; b=lLG/6YB8TfWaw+N7b5zJhBXq+AvY6pJoT/xPMq9QHaIaoIOZZqJA/AcA4m8zGyaAP1Lje8rMiZr5txga/FarxuBjw5iQQ7qp0KP5rO89ZeIUZorfM0LHuYrmb2/MLxybjexRI+8dDpOwuKh/HizVxrK0GNJMHFDi/BgvTG9dM3s= |
VBR-Info: | md=iecc.com; mc=all; mv=dwl.spamhaus.org |
From: | "christian.bau" <christian.bau@cbau.wanadoo.co.uk> |
Newsgroups: | comp.compilers |
Date: | Thu, 12 Jul 2012 09:23:39 -0700 (PDT) |
Organization: | Compilers Central |
References: | 12-07-004 12-07-007 |
Keywords: | C, standards |
Posted-Date: | 12 Jul 2012 17:51:16 EDT |
On Jul 4, 11:43 am, Hans-Peter Diettrich <DrDiettri...@aol.com> 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 <whatever>
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]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.