GCC: How to get all warnings?

Marc Glisse marc.glisse@inria.fr
Wed Aug 10 10:22:00 GMT 2011


On Wed, 10 Aug 2011, Jonathan Wakely wrote:

> On 10 August 2011 09:10, Jeffrey Walton wrote:
>> This is probably going to sound like a dumb question, but here goes:
>> why doen't GCC offer a switch to enable all warnings? And even better,
>
> Noone has implemented it, gcc devs don't think it's useful (or not
> more useful than fixing bugs or adding more useful features first, and
> don't want to have to maintain it) and apparently noone else wants it
> badly enough to do more than open bugzilla reports requesting it.
>
> It probably wouldn't be useful to many people, even the people who
> think they want it.
>
> e.g. do you really want to enable -Wdouble-promotion ?

I can see why one might want all warnings. When you want to know what 
warnings would be useful to you, you can trust Wall/Wextra to make the 
right choice, or you have to go through the doc and add the warnings that 
seem relevant one by one. On the other hand, you could start with all 
warnings and remove the ones that are too noisy one by one, which might be 
easier (especially now that gcc prints the name of the W flag that 
controls a warning next to it), and reduces the chances that you'll miss 
a useful one. It doesn't mean at all that you are going to really use all 
warnings.

Obviously it would need someone willing to implement it...

-- 
Marc Glisse



More information about the Gcc-help mailing list