This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc not recognizing all C99 hex float constants
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 13 Mar 2003 20:21:45 +0000
- Subject: Re: gcc not recognizing all C99 hex float constants
- References: <Pine.LNX.4.33.0303132038000.5124-100000@wotan.suse.de>
Michael Matz wrote:-
> 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 '.').
Well spotted.
> 6.4.4.2 explicitely mentions, that for a 'hexadecimal-fractional-constant'
> the initial 'hexadecimal-digit-sequence' before '.' is optional.
Could you do the obvious patch (+ testcase)? I can do it, but you'll
have to wait a few days.
Neil.