OSDN Git Service

* cppexp.c (cpp_classify_number): Accept '.' after "0x".
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Mar 2003 15:50:53 +0000 (15:50 +0000)
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Mar 2003 15:50:53 +0000 (15:50 +0000)
* testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65091 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cppexp.c
gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c [new file with mode: 0644]

index 820deea..15df443 100644 (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.
index 202b2d0..59a08e9 100644 (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++;
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 (file)
index 0000000..44c49c9
--- /dev/null
@@ -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" } */