cppexp.c (cpp_classify_number): Accept '.' after "0x".

* cppexp.c (cpp_classify_number): Accept '.' after "0x".
	* testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file.

From-SVN: r65091
This commit is contained in:
Michael Matz 2003-03-31 15:50:53 +00:00 committed by Michael Matz
parent 27283c7340
commit 7f1fc38ea4
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-03-31 Michael Matz <matz@suse.de>
* cppexp.c (cpp_classify_number): Accept '.' after "0x".
* testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file.
2003-03-31 Nathan Sidwell <nathan@codesourcery.com>
* gcov.c: Add -a & -u options.

View File

@ -175,7 +175,8 @@ cpp_classify_number (pfile, token)
str++;
/* Require at least one hex digit to classify it as hex. */
if ((*str == 'x' || *str == 'X') && ISXDIGIT (str[1]))
if ((*str == 'x' || *str == 'X')
&& (str[1] == '.' || ISXDIGIT (str[1])))
{
radix = 16;
str++;

View File

@ -0,0 +1,6 @@
/* Test for hex floating point constants: in C99 only. Compiler test. */
/* Origin: Michael Matz <matz@suse.de> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
double d = 0x.2p2; /* { dg-bogus "radix 16" "bogus C99 hex float error" } */