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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131743
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-01-22 Tom Tromey <tromey@redhat.com>
+
+ PR c++/34859:
+ * gcc.dg/cpp/pr34859.c: New file.
+
2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34875
2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34875
--- /dev/null
+/* PR c++/34859.
+ It is ok to redefine __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS. */
+
+/* { dg-do preprocess } */
+
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_CONSTANT_MACROS 1
+
+#define __STDC_LIMIT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+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:
2008-01-07 Fred Fish <fnf@specifix.com>
PR preprocessor/30363:
/* 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,
/* 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
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
node->type = NT_MACRO;
node->value.macro = macro;
if (! ustrncmp (NODE_NAME (node), DSC ("__STDC_"))
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;
node->flags |= NODE_WARN;
return ok;