-# more-warnings.m4 serial 1 (gettext-0.21.2)
+# more-warnings.m4 serial 2 (gettext-0.23)
dnl Copyright (C) 2023 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl that the compiler could often infer and which have little effect on the
dnl performance of the generated code.
nw="$nw -Wsuggest-attribute=cold"
+ dnl With GCC 11 and older, there warnings are pointless:
+ dnl "warning: stack protector not protecting local variables: variable
+ dnl length buffer [-Wstack-protector]", "[-Wanalyzer-use-after-free],
+ dnl "[-Wanalyzer-free-of-non-heap]".
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+ #if __GNUC__ > 11
+ #error "You are lucky"
+ #endif
+ ]])],
+ [nw="$nw -Wstack-protector"
+ nw="$nw -Wanalyzer-use-after-free -Wanalyzer-free-of-non-heap"
+ ])
dnl Setup the list of meaningful warning options for the C compiler.
dnl The list comes from manywarnings.m4. Warning options that are not