aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authortromey <>2008-01-22 21:43:49 +0000
committertromey <>2008-01-22 21:43:49 +0000
commita7807032a3a007e46602c44363718f48d799cb77 (patch)
tree9982c212d99d03c4d7bd4ef933546ad3b4905e2d /libcpp
parent5fdb68785f7e7e54d51cbb1fe98cdd1de48ec515 (diff)
libcpp
PR c++/34859: * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS. gcc/testsuite PR c++/34859: * gcc.dg/cpp/pr34859.c: New file.
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/macro.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 574e0541175..eb2a35cb088 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-22 Tom Tromey <tromey@redhat.com>
+
+ PR c++/34859:
+ * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
+ __STDC_CONSTANT_MACROS.
+
2008-01-07 Fred Fish <fnf@specifix.com>
PR preprocessor/30363:
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 754e2f77b90..3a3bf412724 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -1,7 +1,7 @@
/* Part of CPP library. (Macro and #define handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1696,7 +1696,13 @@ _cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node)
node->type = NT_MACRO;
node->value.macro = macro;
if (! ustrncmp (NODE_NAME (node), DSC ("__STDC_"))
- && ustrcmp (NODE_NAME (node), (const uchar *) "__STDC_FORMAT_MACROS"))
+ && ustrcmp (NODE_NAME (node), (const uchar *) "__STDC_FORMAT_MACROS")
+ /* __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are mentioned
+ in the C standard, as something that one must use in C++.
+ However DR#593 indicates that these aren't actually mentioned
+ in the C++ standard. We special-case them anyway. */
+ && ustrcmp (NODE_NAME (node), (const uchar *) "__STDC_LIMIT_MACROS")
+ && ustrcmp (NODE_NAME (node), (const uchar *) "__STDC_CONSTANT_MACROS"))
node->flags |= NODE_WARN;
return ok;