On 21/09/2023 22:31, Paul Eggert wrote:
On 2023-09-21 13:21, Pádraig Brady wrote:

I was trying to use -Wpedantic to check for standards conformance,
where some code compilable on gcc 13 by default, is no longer compilable
on gcc <= 10.

Like Bruno, I've not had much luck with -Wpedantic for doing that. The
GCC manual even has qualms about it.


  ever since commit:
https://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=4f6131a786
if the user specifies --Wpedantic, then it's ignored
(and that's not at all obvious as there are early warnings before the pragma).

I tried to work around that problem by installing the attached patch.
Please give it a try. Even if -Wpedantic has problems, it's better if
Gnulib doesn't override the builder unnecessarily.

Yes that works well, and is less surprising.

  $ make CFLAGS='-O2 -Wpedantic -Wno-error' 2>&1 | grep 'src/.*warning:' |
  grep -Ev '_Noreturn|_Static_assert'

  src/tail.c:2211:11: warning: a label can only be part of a statement \
  and a declaration is not a statement [-Wpedantic]

thanks!
Pádraig

Reply via email to