This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44272] New: Wrong interpretation of hex constant as floating point value.
- From: "draqsn at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2010 14:47:02 -0000
- Subject: [Bug c/44272] New: Wrong interpretation of hex constant as floating point value.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc 4.5.0, built for arm-elf
Problems with compiling following code:
int ret_const(void)
{
return 0x12E+2;
}
GCC claims that:
test.c: In function 'ret_const':
test.c:3:12: error: invalid suffix "+2" on integer constant
test.c:4:1: warning: control reaches end of non-void function
This is because GCC thinks that 0x12E+2 is a floating point number, while this
is just an addition of two integers.
Adding spaces around '+' solves the problem, but this is definitely bug.
It persists with all versions of GCC 4.4.x and 4.5.0
--
Summary: Wrong interpretation of hex constant as floating point
value.
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: draqsn at mail dot ru
GCC build triplet: all
GCC host triplet: all
GCC target triplet: all
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44272