diff options
author | Michael Matz <matz@suse.de> | 2003-03-31 15:50:53 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2003-03-31 15:50:53 +0000 |
commit | 7f1fc38ea4593a4b0ae1333eefe028d1464d2a9b (patch) | |
tree | b82b0cc4c7c7cce81e85c0deb5296342aba42d96 /gcc | |
parent | 27283c7340100bf70de6af824143c052cc9d0c76 (diff) | |
download | gcc-7f1fc38ea4593a4b0ae1333eefe028d1464d2a9b.zip gcc-7f1fc38ea4593a4b0ae1333eefe028d1464d2a9b.tar.gz gcc-7f1fc38ea4593a4b0ae1333eefe028d1464d2a9b.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cppexp.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 820deea..15df443 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/cppexp.c b/gcc/cppexp.c index 202b2d0..59a08e9 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -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++; diff --git a/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c b/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c new file mode 100644 index 0000000..44c49c9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c @@ -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" } */ |