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.

Reply via email to