From e7872b37f95c560cc1b6bac82da2cf56770ec235 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 20 Sep 2021 01:06:48 +0300 Subject: [PATCH 36/36] 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 aef78c05ce..4a99ba6a98 100644 --- a/m4/debug.m4 +++ b/m4/debug.m4 @@ -42,10 +42,14 @@ if test "x$enable_debug" = "xyes" -o "x$enable_debug" = "xchecks"; then AC_DEFINE([FREECIV_DEBUG], [1], [Extra debugging support]) 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 -Wold-style-definition \ - -Wtype-limits], + -Wtype-limits -Wno-array-bounds], [], [EXTRA_DEBUG_CFLAGS]) if test "x$cxx_works" = "xyes" ; then FC_CXX_FLAGS([-Werror -Wmissing-prototypes -Wmissing-declarations \ -- 2.33.0