|
From: | Paul Eggert |
Subject: | Problems testing Bison with GCC 12.1 |
Date: | Sun, 31 Jul 2022 13:42:29 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 7/31/22 04:08, Akim Demaille wrote:
Reported by clang's -Wunused-but-set-variable warning.
I noticed that bleeding-edge Bison no longer passes 'make check' with current GCC (12.1) if one configures with --enable-gcc-warnings.
It's been a while since I built Bison; when I just now tried it I got some warnings from ./bootstrap and from GCC 12.1 and from a pedantic private 'grep' on Fedora x86-64, which I fixed with the attached patches which I hope are OK.
Unfortunately there are still several failures in the tests. Tests 306, 311, 322, 652 fail with diagnostics like "'yylval' may be used uninitialized [-Werror=maybe-uninitialized]". Many C++ tests (400-25, 440-53, 664-5, 667-76, 679-80, 682-3, 685-9, 692) fail with diagnostics like "noexcept-expression evaluates to 'false' because of a call to 'yy::parser::stack_symbol_type::stack_symbol_type()' [-Werror=noexcept]". One glr2.cc test (552) fails with "variable 'yyerrloc' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]".
A simple way to fix the -Wmaybe-uninitialized stuff is to omit -Wmaybe-uninitialized when compiling tests. There may be similar ways to work around the other issues. Of course there are pros and cons to simply disabling the static checking.
At some point perhaps Bison should adopt Gnulib's manywarnings module, which tracks GCC warnings well. There are some new GCC warnings that I've found useful when compiling other programs.
0001-gnulib-update.patch
Description: Text Data
0002-maint-don-t-get-fdl.texi-from-Gnulib.patch
Description: Text Data
0003-maint-improve-Gnulib-checking.patch
Description: Text Data
0004-maint-don-t-use-in-BREs-and-EREs.patch
Description: Text Data
0005-maint-update-.gitignore-for-Gnulib.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |