summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-11 09:20:07 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-11 09:20:07 +0000
commit7ff6cfb384fc0023e77466afa58bbdc117e4cd46 (patch)
tree24bb32afacf6702b2c625a2a53eac39fadac1484
parent3582b939326a42e71378ad0e3ecb08c73a14143e (diff)
downloadgcc-7ff6cfb384fc0023e77466afa58bbdc117e4cd46.tar.gz
PR bootstrap/63699
PR bootstrap/63750 * system.h: Include <string> before "safe-ctype.h" * wide-int.h (wi::smin, wi::smax, wi::umin, wi::umax): Prefix calls to min/max with wi namespace. * ipa-chkp.c: Don't include <string>. * plugin.cc: Don't include <string>. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217342 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/ipa-chkp.c1
-rw-r--r--gcc/system.h7
-rw-r--r--gcc/wide-int.h8
-rw-r--r--libcc1/ChangeLog6
-rw-r--r--libcc1/plugin.cc2
6 files changed, 26 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b19ce48fb01..f86c51baf8c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR bootstrap/63699
+ PR bootstrap/63750
+ * system.h: Include <string> before "safe-ctype.h"
+ * wide-int.h (wi::smin, wi::smax, wi::umin, wi::umax): Prefix
+ calls to min/max with wi namespace.
+ * ipa-chkp.c: Don't include <string>.
+
2014-11-11 Terry Guo <terry.guo@arm.com>
* doc/invoke.texi (-masm-syntax-unified): Reword and fix typo.
diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c
index f910583907d..19a989453b6 100644
--- a/gcc/ipa-chkp.c
+++ b/gcc/ipa-chkp.c
@@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "tree-chkp.h"
#include "ipa-chkp.h"
-#include <string>
/* Pointer Bounds Checker has two IPA passes to support code instrumentation.
diff --git a/gcc/system.h b/gcc/system.h
index 74ddfe94a59..c05f02d6273 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -194,6 +194,13 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
#undef fread_unlocked
#undef fwrite_unlocked
+/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
+ the ctype macros through safe-ctype.h */
+
+#ifdef __cplusplus
+# include <string>
+#endif
+
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
replacement instead. */
diff --git a/gcc/wide-int.h b/gcc/wide-int.h
index 2cbcbd21494..00c7d6ec0e4 100644
--- a/gcc/wide-int.h
+++ b/gcc/wide-int.h
@@ -2129,7 +2129,7 @@ template <typename T1, typename T2>
inline WI_BINARY_RESULT (T1, T2)
wi::smin (const T1 &x, const T2 &y)
{
- return min (x, y, SIGNED);
+ return wi::min (x, y, SIGNED);
}
/* Return the minimum of X and Y, treating both as unsigned values. */
@@ -2137,7 +2137,7 @@ template <typename T1, typename T2>
inline WI_BINARY_RESULT (T1, T2)
wi::umin (const T1 &x, const T2 &y)
{
- return min (x, y, UNSIGNED);
+ return wi::min (x, y, UNSIGNED);
}
/* Return the maxinum of X and Y, treating them both as having
@@ -2160,7 +2160,7 @@ template <typename T1, typename T2>
inline WI_BINARY_RESULT (T1, T2)
wi::smax (const T1 &x, const T2 &y)
{
- return max (x, y, SIGNED);
+ return wi::max (x, y, SIGNED);
}
/* Return the maximum of X and Y, treating both as unsigned values. */
@@ -2168,7 +2168,7 @@ template <typename T1, typename T2>
inline WI_BINARY_RESULT (T1, T2)
wi::umax (const T1 &x, const T2 &y)
{
- return max (x, y, UNSIGNED);
+ return wi::max (x, y, UNSIGNED);
}
/* Return X & Y. */
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog
index 431b28859d5..5624bf67964 100644
--- a/libcc1/ChangeLog
+++ b/libcc1/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR bootstrap/63699
+ PR bootstrap/63750
+ * plugin.cc: Don't include <string>.
+
2014-10-29 Jakub Jelinek <jakub@redhat.com>
Phil Muldoon <pmuldoon@redhat.com>
diff --git a/libcc1/plugin.cc b/libcc1/plugin.cc
index 5cdd19d78ce..7b5df1d24fa 100644
--- a/libcc1/plugin.cc
+++ b/libcc1/plugin.cc
@@ -55,8 +55,6 @@
#include "connection.hh"
#include "rpc.hh"
-#include <string>
-
#ifdef __GNUC__
#pragma GCC visibility push(default)
#endif