libcpp
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Nov 2007 18:24:01 +0000 (18:24 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Nov 2007 18:24:01 +0000 (18:24 +0000)
PR preprocessor/32868:
* macro.c (_cpp_create_definition): Special case
__STDC_FORMAT_MACROS.
gcc/testsuite
PR preprocessor/32868:
* gcc.dg/cpp/pr32868.c: New file.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/pr32868.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/macro.c

index cdcb4d1..1751a3d 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-30  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/32868:
+       * gcc.dg/cpp/pr32868.c: New file.
+
 2007-11-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/34248
diff --git a/gcc/testsuite/gcc.dg/cpp/pr32868.c b/gcc/testsuite/gcc.dg/cpp/pr32868.c
new file mode 100644 (file)
index 0000000..ea89621
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR preprocessor/32868.  It is ok to redefine __STDC_FORMAT_MACROS.  */
+
+/* { dg-do preprocess } */
+
+#define __STDC_FORMAT_MACROS 1
+#define __STDC_FORMAT_MACROS 1
index bac5e86..3701c80 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-30  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/32868:
+       * macro.c (_cpp_create_definition): Special case
+       __STDC_FORMAT_MACROS.
+
 2007-11-16  Michael Matz  <matz@suse.de>
 
        * files.c (search_path_head): Fix check for absolute paths.
index f3a4420..754e2f7 100644 (file)
@@ -1695,7 +1695,8 @@ _cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node)
   /* Enter definition in hash table.  */
   node->type = NT_MACRO;
   node->value.macro = macro;
-  if (! ustrncmp (NODE_NAME (node), DSC ("__STDC_")))
+  if (! ustrncmp (NODE_NAME (node), DSC ("__STDC_"))
+      && ustrcmp (NODE_NAME (node), (const uchar *) "__STDC_FORMAT_MACROS"))
     node->flags |= NODE_WARN;
 
   return ok;