From de1f1792d0a096e06bed23c762682d0455ea6e27 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 20 Sep 2021 01:37:57 +0300 Subject: [PATCH 9/9] debug.m4: Disable array-bounds warnings when -Werror present See osdn #42885 Signed-off-by: Marko Lindqvist --- m4/debug.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/m4/debug.m4 b/m4/debug.m4 index 0f5aecca9b..a92d09e604 100644 --- a/m4/debug.m4 +++ b/m4/debug.m4 @@ -43,9 +43,13 @@ if test "x$enable_debug" = "xyes" -o "x$enable_debug" = "xchecks"; then AC_DEFINE([DEBUG], [1], [Extra debugging support, backward compatibility macro]) AC_DEFINE([LUA_USE_APICHECK], [1], [Lua Api checks]) + dnl With -Werror we have to have -Wno-array-bounds as gcc-12 generates + dnl a false positive about that kind of error. + dnl Deemed not-a-bug by gcc people: + dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102405 FC_C_FLAGS([-Werror -Wmissing-prototypes -Wmissing-declarations \ -Wformat -Wformat-security -Wnested-externs \ - -Wshadow -Wold-style-declaration], + -Wshadow -Wold-style-declaration -Wno-array-bounds], [], [EXTRA_DEBUG_CFLAGS]) if test "x$cxx_works" = "xyes" ; then FC_CXX_FLAGS([-Werror -Wmissing-prototypes \ -- 2.33.0