aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cppexp.c3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c6
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" } */