BUILD: debug: silence warning on gcc-5
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.
(cherry picked from commit 481edaceb8f1cb2fa817ca4c4d6dec12edef17c9)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 6a5348101c82a0f35389813eda452d38949159ee)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 78a6fdff93d110bc9ad3c19ec5be3ca5a849e7d5)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h
index a2a9f6d..445dd7c 100644
--- a/include/haproxy/bug.h
+++ b/include/haproxy/bug.h
@@ -42,8 +42,10 @@
#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)
#pragma GCC diagnostic pop