|
From: | Paul Eggert |
Subject: | Re: diffseq: Silence gcc warning |
Date: | Sat, 27 May 2023 09:55:12 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
On 2023-05-27 09:25, Bruno Haible wrote:
For 30 years, "gcc -Wall" has been and is the best recipe for getting meaningful warnings across packages. It's not like a "random compiler".
It can be a random compiler if you use GCC the wrong way. If you use an old version of GCC it might generate bogus diagnostics. Or if you combine -Wall with some other options (-mx32, -Og, etc.) it might generate bogus diagnostics. We shouldn't waste time pacifying gcc on every possible platform with every possible set of options (each of which is in effect a new platform), especially when this pacification might create false negatives.
For programs like diffutils that use the manywarnings module, the best way to generate warnings is to configure with --enable-gcc-warnings. If there are other ways to generate warnings to find bugs that are worth the trouble of pacifying GCC, then it'd be helpful to use those ways too. But plain 'gcc -Wall' is not one of those ways.
But when gcc 14 is released, with new warning options in -Wall and possibly regressions, some new workarounds may be needed.
Yes, and this is a normal course of affairs. I routinely do that with each GCC release, and update the manywarnings module accordingly. This process works well, for programs that use that module. It works better than gcc -Wall does, in my experience.
[Prev in Thread] | Current Thread | [Next in Thread] |