This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/33547] New: invalid suffix "+0x23" on integer constant
- From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2007 20:03:10 -0000
- Subject: [Bug preprocessor/33547] New: invalid suffix "+0x23" on integer constant
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling the following simple snippet:
void foo(void)
{
int i = 0x4E+0x23;
}
triggers the error message indicated in the summary.
Analysis of the problem shows that the macro VALID_SIGN() used inside
lex_number() (libcpp/lex.c) misidentifiex the plus sign following the
E (possible exponent) character as still being part of the number, even
though this is impossible since the number started with 0x, so the
exponent is required to be introduced with `p' or `P'.
IMHO, the number parser needs to detect the possible 0x prefix early,
and pass this information down to VALID_SIGN() so this macro can
definately decide whether either of `p' or `e' is the valid exponent
character within the current context.
--
Summary: invalid suffix "+0x23" on integer constant
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: j at uriah dot heep dot sax dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33547