Article View: gnu.gcc.bug
Article #5922pp-tokens --> tokens bug.
From: Peter Seebach
Date: Wed, 29 Jan 1997 00:00
Date: Wed, 29 Jan 1997 00:00
33 lines
1501 bytes
1501 bytes
#define y 10
int main(void) {
float x;
x = .y;
return 0;
}
This program is invalid, because it contains the token sequence
"x" "=" "." "10" ";". gcc accepts it, apparently as
"x" "=" ".10" ";". So far as I can tell, gcc is retokenizing, but
the standard says "each preprocessing token is converted into a token"
in phase 7, so the "." and the "10" should each be a token.
I see no trivial fix, although I think at this point in translation
it's easy enough to just add spaces *before* expansions as well as
after them. (It appears, from the -E'd line
x = .10 ;
, that gcc is already adding a space *after* the 10.)
The cpp provided with lcc produces
x = . 10;
which, of course, gets the right diagnostic.
-s
p.s.: I would like to take this opportunity to thank the gcc developers for
making it fairly hard to find bugs, and for graciously accepting my bug
reports on those occasions when I'm right. If only commercial vendors were
as earnest in their efforts...
Technical Details
Message-ID:
<9701291439.AA00678@moose.intran.xerox.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,6742f5eeb77e4a77,start X-Google-Attributes: gid113d02,public From: seebs@intran.xerox.com (Peter Seebach) Subject: pp-tokens --> tokens bug. Date: 1997/01/29 Message-ID: <9701291439.AA00678@moose.intran.xerox.com> X-Deja-AN: 212988433 sender: bug-gcc-request@prep.ai.mit.edu x-gateway: relay3.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 29 Jan 1997 09:35:16 EST newsgroups: gnu.gcc.bug