summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/system.h b/src/system.h
index 0210f6c6..6073048f 100644
--- a/src/system.h
+++ b/src/system.h
@@ -73,9 +73,14 @@ typedef size_t uintptr_t;
# include <verify.h>
# include <xalloc.h>
-
-/* See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html. */
-# if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ < 5
+// Clang and ICC like to pretend they are GCC.
+#if defined __GNUC__ && !defined __clang__ && !defined __ICC
+# define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
+// See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html
+// and https://trac.macports.org/ticket/59927.
+#if defined GCC_VERSION && 405 <= GCC_VERSION
# define IGNORE_TYPE_LIMITS_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"")