bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warnings from gzip and diffutils


From: Simon Josefsson
Subject: Re: warnings from gzip and diffutils
Date: Wed, 18 Dec 2024 20:28:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Bruno Haible via Gnulib discussion list <bug-gnulib@gnu.org> writes:

> Paul Eggert wrote:
>> On 2024-12-17 17:21, Bruno Haible via Gnulib discussion list wrote:
>> > Therefore, how about applying -Werror only to a subset of all
>> > warnings, hand-picked by the maintainer?
>> 
>> We already tailor warnings from Gnulib as opposed to warnings from the 
>> main program
>
> Oh I see: Code that sets GNULIB_WARN_CFLAGS is already present in
> gzip/configure.ac (and likewise in coreutils, grep, tar) but not yet in
> diffutils/configure.ac.
>
>   # We use a slightly smaller set of warning options for lib/.
>   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
>   nw=
>   ...
>   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
>   AC_SUBST([GNULIB_WARN_CFLAGS])
>
> How about adding this block to the configure.ac of 
>   diffutils
>   bison
>   m4
>   sed
> that use the same idiom? Even if for the moment, nw remains empty here,
> the comment would make it clear that this is the mechanism to disable
> some warning options for lib/, and this would reduce the pressure on
> gnulib do placate style warnings like the two recent ones.

A long-standing todo for me has been to push the manywarnings idiom into
a gnulib function instead of forcing it into maintainer configure.ac's.

In libidn2 I use the following block which adds the additional
--enable-gcc-warnings=error alternative, which I've found quite useful.

Line 96-168:

https://gitlab.com/libidn/libidn2/-/blob/61ee87ee229c811bd9bf945084645058249b52cc/configure.ac#L96

As far as I can tell, all of those lines could all be replaced into
something like this:

gl_MEGAWARNINGS([-fanalyzer -Wbad-function-cast ... # unwantedflags],
                [-Wno-error=analyzer-use-of-uninitialized-value ... # error 
flags])

and it could be used for all packages.  There is a lot of cut'n'paste
logical code now that is duplicated.

Maybe some additional parametrization is necessary to accomodate for all
possible uses.  Or at least make sure simple additional post-processing
after running the gl_MEGAWARNINGS is possible.

Thoughts?

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]