aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-01-06 19:41:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-01-06 19:41:23 +0100
commit75213cc0e4b3afd8e677f25e4fe9201f1b856f33 (patch)
treeebd5bb77a7e172ea127be4131f30b16e786f21f5 /gcc/system.h
parent9a38f84e274c6724172ec676285277a3003336ee (diff)
downloadgcc-75213cc0e4b3afd8e677f25e4fe9201f1b856f33.zip
gcc-75213cc0e4b3afd8e677f25e4fe9201f1b856f33.tar.gz
gcc-75213cc0e4b3afd8e677f25e4fe9201f1b856f33.tar.bz2
system.h (GCC_DIAGNOSTIC_PUSH_IGNORED, [...]): Define.
* system.h (GCC_DIAGNOSTIC_PUSH_IGNORED, GCC_DIAGNOSTIC_POP, GCC_DIAGNOSTIC_STRINGIFY): Define. * simplify.c (simplify_transformation_to_array): Use GCC_DIAGNOSTIC_PUSH_IGNORED and GCC_DIAGNOSTIC_POP instead of #pragma GCC diagnostic {push,ignored,pop}. From-SVN: r244179
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index c6fb0e2..0cd58db 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1140,6 +1140,18 @@ helper_const_non_const_cast (const char *p)
#define VALGRIND_FREELIKE_BLOCK(x,y)
#endif
+/* Macros to temporarily ignore some warnings. */
+#if GCC_VERSION >= 6000
+#define GCC_DIAGNOSTIC_STRINGIFY(x) #x
+#define GCC_DIAGNOSTIC_PUSH_IGNORED(x) \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma (GCC_DIAGNOSTIC_STRINGIFY (GCC diagnostic ignored #x))
+#define GCC_DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop")
+#else
+#define GCC_DIAGNOSTIC_PUSH_IGNORED(x)
+#define GCC_DIAGNOSTIC_POP
+#endif
+
/* In LTO -fwhole-program build we still want to keep the debug functions available
for debugger. Mark them as used to prevent removal. */
#if (GCC_VERSION > 4000)