Hi Paul,

Paul Eggert <[email protected]> writes:

> * build-aux/gcc-warning.spec: Add options introduced in GCC 16.
> Remove -Wfree-labels (not limited to objc), -Wuseless-cast
> (not limited to c++ and objc++).
> * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wfree-labels,
> -Wkeyword-macro (new to GCC 16), -Wuseless-casts.
> ---
>  ChangeLog                  | 7 +++++++
>  build-aux/gcc-warning.spec | 8 ++++++--
>  m4/manywarnings.m4         | 3 +++
>  3 files changed, 16 insertions(+), 2 deletions(-)

After updating gnulib's submodule in coreutils with this commit you will
see the following:

    $ gcc --version | head -n 1
    gcc (GCC) 16.0.1 20260321 (Red Hat 16.0.1-0)
    gcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src  -Werror -fstrict-flex-arrays 
-Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time 
-Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra 
-Wflex-array-member-not-at-end -Wformat-signedness -Wfree-labels -Winit-self 
-Winvalid-pch -Wkeyword-macro -Wlogical-op -Wmissing-declarations 
-Wmissing-include-dirs -Wmissing-prototypes -Wmissing-variable-declarations 
-Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd 
-Woverlength-strings -Wpacked -Wpointer-arith -Wshadow -Wstrict-flex-arrays 
-Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold 
-Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=malloc 
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsync-nand -Wtrampolines 
-Wuninitialized -Wunknown-pragmas -Wunsafe-loop-optimizations -Wunused-macros 
-Wvariadic-macros -Wvector-operation-performance -Wvla -Wwrite-strings 
-Warray-bounds=2 -Wattribute-alias=2 -Wbidi-chars=any,ucn -Wformat=2 
-Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wuse-after-free=3 
-Wunused-const-variable=2 -Wvla-larger-than=4031 
-Wzero-as-null-pointer-constant -Wswitch-enum -Wtrailing-whitespace 
-Wno-sign-compare -Wno-format-nonliteral -g -O2 -MT src/chroot.o -MD -MP -MF 
$depbase.Tpo -c -o src/chroot.o src/chroot.c &&\
    mv -f $depbase.Tpo $depbase.Po
    In file included from src/chroot.c:19:
    ./lib/config.h:5471:9: error: keyword 'restrict' defined as macro 
[-Werror=keyword-macro]
     5471 | #define restrict __restrict__
          |         ^~~~~~~~
    cc1: all warnings being treated as errors

What do you think is the best way to fix this? Perhaps AC_C_RESTRICT in
m4/gnulib-common.m4 can remove the definition on GCC or Clang? The
comment in that macro makes it seem that the use of __restrict__ is for
soley for other compilers.

Collin

Reply via email to