From 78f7aef9304979d7796dd7d3fc5a2d92d1da0ca6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 23 Apr 2023 08:53:59 -0700 Subject: manywarnings: update C warnings for GCC 13 Adjust for C programs compiled by GCC 13. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 13. * doc/manywarnings.texi (manywarnings): Document flex arrays. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fstrict-flex-arrays and -Wstrict-flex-arrays as these should be suitable for Gnulib-using code. --- doc/manywarnings.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/manywarnings.texi b/doc/manywarnings.texi index 32237dc67f..ea1b758cc0 100644 --- a/doc/manywarnings.texi +++ b/doc/manywarnings.texi @@ -80,6 +80,13 @@ The @code{-fanalyzer} option generates many false alarms about @code{malloc} leaks, which @code{manywarnings} suppresses by also using @option{-Wno-analyzer-malloc-leak}. +@item -fstrict-flex-arrays +The @code{manywarnings} module by default uses GCC's +@option{-fstrict-flex-arrays} option if available, so that GCC can +warn about nonportable usage of flexible array members. +In a few cases this can help GCC generate better code, +so it is not strictly a warning option. + @item -Wsign-compare GCC and Clang generate too many false alarms with @option{-Wsign-compare}, and we don't recommend that warning. You can disable it by using -- cgit v1.2.1