🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4151

Re: sizeof != identifier

#4151
From: Tanmoy Bhattacharya
Date: Sun, 01 Oct 1995 17:44
35 lines
2261 bytes
In article <DANIELV.95Oct1122701@crt0.crt>, danielv@crt0.crt (Daniel
Villeneuve) writes: 
|> 
|> As I'm reading the lexical rules of the standard, it appears to me that, as
|> early as translation phase 3, the file is decomposed into a stream of
|> preprocessing tokens and the `sizeof' string is then converted into the
|> `operator' token as listed in section 3.1.5.  If so, this prohibits the use
|> of `sizeof' as an identifier anywhere in a program, including in the syntax
|> rule for defining macros, which reads like this:

sizeof is also listed under the `keywords', and I thought keyword tokens were
generated from identifier pp-tokens. If sizeof does is not an identifier
pp-token (in fact the rules seem ambiguous: it could be parsed both as an
operator and as an identifier), then I cannot see how one would ever get a
sizeof keyword token.

I guess everything hold together if one assumes that the `sizeof' in the
definition of operator is the result of reduction of `sizeof' keyword token,
and not the sequence of source code characters `s' `i' .. `f'. As at the
preprocessing stage there is no keyword tokens at all, the `sizeof' operator
pp-token can never be generated. However, `sizeof' operator token is
perfectly possible at a later stage.

Where in the standard does it specify this? In fact, where does the standard
state which pp-token becomes which token?

Cheers
Tanmoy
-- 
tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87544-0285,USA H:#3,802,9 St,NM87545
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: <44mk1m$jop@newshost.lanl.gov>
Path: arc1-ca.pugleaf.net!qcd.lanl.gov!tanmoy
References: <DANIELV.95Oct1122701@crt0.crt>

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: sizeof != identifier
Date: 1 Oct 1995 17:44:21 GMT
Organization: Los Alamos National Laboratory
Distribution: world
Message-ID: <44mk1m$jop@newshost.lanl.gov>
References: <DANIELV.95Oct1122701@crt0.crt>
NNTP-Posting-Host: qcd.lanl.gov