]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug: silence warning on gcc-5
authorWilly Tarreau <w@1wt.eu>
Sun, 10 Jul 2022 11:09:54 +0000 (13:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 Jul 2022 12:13:48 +0000 (14:13 +0200)
In 2.6, 8a0fd3a36 ("BUILD: debug: work around gcc-12 excessive
-Warray-bounds warnings") disabled some warnings that were reported
around the the BUG() statement. But the -Wnull-dereference warning
isn't known from gcc-5, it only arrived in gcc-6, hence makes gcc-5
complain loudly that it doesn't know this directive. Let's just
condition this one to gcc-6.

include/haproxy/bug.h

index 6a75177e1214a836c0248d0784be9604f50a7c1d..e6303fd3cba70322e810e41fa5c4b8cab20ad99d 100644 (file)
@@ -45,7 +45,9 @@ static inline __attribute((always_inline)) void ha_crash_now(void)
 #if __GNUC_PREREQ__(5, 0)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Warray-bounds"
+#if __GNUC_PREREQ__(6, 0)
 #pragma GCC diagnostic ignored "-Wnull-dereference"
+#endif
 #endif
        *(volatile char *)1 = 0;
 #if __GNUC_PREREQ__(5, 0)