This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc not recognizing all C99 hex float constants
- From: Michael Matz <matz at suse dot de>
- To: <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Mar 2003 20:43:33 +0100 (CET)
- Subject: gcc not recognizing all C99 hex float constants
Hi,
I noticed, that even in C99 mode gcc doesn't recognize all hexadecimal
floating point constants.
Compile this with "gcc -std=c99":
float f = 0x.9p0;
this gives the error
ppnumber.c:1:11: invalid suffix "x.9p0" on integer constant
This is because cppexp.c:cpp_classify_number() only wants to go to base 16
(after it sees "0x"), if the following char is a hex digit (i.e. it
doesn't like the '.').
6.4.4.2 explicitely mentions, that for a 'hexadecimal-fractional-constant'
the initial 'hexadecimal-digit-sequence' before '.' is optional.
Ciao,
Michael.