Paul Eggert <[email protected]> writes:

> On 2026-03-02 02:16, Simon Josefsson wrote:
>> I've not felt a need to ignore those, and the design philosophy of
>> manywarnings is to enable ALL possible warnings and then allow
>> maintainer to back out of things that they disagree with.
>
> Yes, that's the basic idea, though we do omit some warnings where we
> think they're invariably counterproductive in Gnulib-using code, e.g.,
> -Waggregate-return, -Walloc-zero, -Walloca (see
> build-aux/gcc-warning.spec for more). Many omitted warnings are
> no-brainers, whereas some (e.g., -Wcast-qual) are debatable.
>
> Given that basic idea, when in doubt it's better to not omit debatable
> warnings, so that the maintainer can back out unwanted
> warnings. Perhaps we should even rethink -Wcast-qual and a few others,
> though any change there might be painful.
>
> Of the warnings Bruno listed, -Wgnu-include-next seems a no-brainer
> given that Gnulib uses include_next so often.

Hmm - none of manywarnings enabled flags applies to gnulib code, does
it?  It is just for non-gnulib directories, and even then opt-in by
requiring changes to per-directory Makefile.am.

And isn't -Wgnu-include-next clever enough to only apply to the *.c file
being compiled?  It wouldn't complain if some header file included by
the *.c file (like a gnulib header file) used #include_next, would it?

I have never needed to drop -Wgnu-include-next from packages I work on.

> The others look like they might be more-debatable style issues, though
> I'm by no means expert in running across them.
>
>
>> We could provide some pre-defined set of warnings to ignore, for
>> maintainers who wish to opt-in and ignore entire sets of warnings,
>> perhaps?
>
> Yes, we could support something finer-grained than just the "list all
> possibly-useful warnings" set that we do now. But then we'd have to
> maintain yet another set (or sets) of warnings, and figure out what
> the inclusion criteria are.

I'm using the module in several packages, and I haven't found any subset
of flags that is reasonable for a wider set of packages.

Perhaps -Wsystem-headers is common to ignore though, but not everywhere.

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to