summaryrefslogtreecommitdiff
path: root/diag-control.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-03-21 20:33:44 -0700
committerGuy Harris <guy@alum.mit.edu>2018-03-21 20:33:44 -0700
commit3657632fe92edafc5bfcab40e365e4f57dd29f77 (patch)
tree80b88f72a2251ad62f2e08dd3ac9e2f2b1c975d8 /diag-control.h
parent145f670e2502f29eb517514e40e8e0cf8af295cc (diff)
downloadlibpcap-3657632fe92edafc5bfcab40e365e4f57dd29f77.tar.gz
We need at least GCC 4.6 for pushing and popping warnings.
Diffstat (limited to 'diag-control.h')
-rw-r--r--diag-control.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/diag-control.h b/diag-control.h
index c36a6ba0..162470ea 100644
--- a/diag-control.h
+++ b/diag-control.h
@@ -83,10 +83,11 @@
PCAP_DO_PRAGMA(clang diagnostic ignored "-Wsign-compare")
#define DIAG_ON_FLEX \
PCAP_DO_PRAGMA(clang diagnostic pop)
- #elif PCAP_IS_AT_LEAST_GNUC_VERSION(4,2)
+ #elif PCAP_IS_AT_LEAST_GNUC_VERSION(4,6)
/*
- * This is GCC 4.2 or later, or a compiler claiming to be that.
- * We can use "GCC diagnostic ignored -Wxxx".
+ * This is GCC 4.6 or later, or a compiler claiming to be that.
+ * We can use "GCC diagnostic ignored -Wxxx" (introduced in 4.2)
+ * and "GCC diagnostic push/pop" (introduced in 4.6).
*/
#define DIAG_OFF_FLEX \
PCAP_DO_PRAGMA(GCC diagnostic push) \
@@ -94,6 +95,10 @@
#define DIAG_ON_FLEX \
PCAP_DO_PRAGMA(GCC diagnostic pop)
#else
+ /*
+ * Neither Clang 2.8 or later nor GCC 4.6 or later or a compiler
+ * claiming to be that; there's nothing we know of that we can do.
+ */
#define DIAG_OFF_FLEX
#define DIAG_ON_FLEX
#endif
@@ -124,10 +129,11 @@
PCAP_DO_PRAGMA(clang diagnostic ignored "-Wshadow")
#define DIAG_ON_BISON_BYACC \
PCAP_DO_PRAGMA(clang diagnostic pop)
- #elif PCAP_IS_AT_LEAST_GNUC_VERSION(4,2)
+ #elif PCAP_IS_AT_LEAST_GNUC_VERSION(4,6)
/*
- * This is GCC 4.2 or later, or a compiler claiming to be that.
- * We can use "GCC diagnostic ignored -Wxxx".
+ * This is GCC 4.6 or later, or a compiler claiming to be that.
+ * We can use "GCC diagnostic ignored -Wxxx" (introduced in 4.2)
+ * and "GCC diagnostic push/pop" (introduced in 4.6).
*/
#define DIAG_OFF_BISON_BYACC \
PCAP_DO_PRAGMA(GCC diagnostic push) \
@@ -136,7 +142,7 @@
PCAP_DO_PRAGMA(GCC diagnostic pop)
#else
/*
- * Neither Clang 2.8 or later nor GCC 4.2 or later or a compiler
+ * Neither Clang 2.8 or later nor GCC 4.6 or later or a compiler
* claiming to be that; there's nothing we know of that we can do.
*/
#define DIAG_OFF_BISON_BYACC