Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: pabristow on July 15, 2020, 03:46:12 pm

Title: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: pabristow on July 15, 2020, 03:46:12 pm

-Weverything option leads to far too many warnings - is strongly unrecommended - in favour of -Wall.

C:\Program Files\CodeBlocks\share\CodeBlocks\templates\wizard\common_functions.script

contains line 52

    else if (   GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("clang")) )
    {
        base.AddCompilerOption(_T("-Weverything"));
    }

https://quuxplusone.github.io/blog/2018/12/06/dont-use-weverything/

Arthur O’Dwyer says

"Put -W -Wall in your build flags.
The Clang devs will take care of making sure this is a sensible warning level for all codebases, including yours.
Listen to the Clang devs when they say, “Don’t put -Weverything in your build flags.”
Posted 2018-12-06
"

May I suggest that the line below would be better. I find that -Weverything  takes hours to compiler with reams of logs, and I can't see the wood for the trees. Anyone with much cleaner code than mine can always add -Weverything if they wish ;-)

use -Wall as default warning level. base.AddCompilerOption(_T("-Wall"));

Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: oBFusCATed on July 15, 2020, 08:31:24 pm
Patches welcome? Defaults are debatable I don't intend to debate them, but I don't intend to change it at the moment.

Some day I'll get to the annoying slowness of the logs and I'll make it usable. :(
Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: pabristow on July 17, 2020, 06:46:28 pm
OK - I have patched my version so I am happy for now.
There seems to be a very firm recommendation not to use -Weverything unless you are Clang developer, so any debate seems to have a clear outcome.

What form would you like a patch - it's change line 52 from

        base.AddCompilerOption(_T("-Weverything"));

to

        base.AddCompilerOption(_T("-Wall"));

The problem is not the speed of the logs, it's the volume!
Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: oBFusCATed on July 18, 2020, 12:06:47 pm
There seems to be a very firm recommendation not to use -Weverything unless you are Clang developer, so any debate seems to have a clear outcome.
Do you have a link where this claim can be verified?

For the patch: Either something which could be applied with git or svn...
Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: callahanp on June 19, 2021, 06:10:56 pm
as for justification in general, try this https://quuxplusone.github.io/blog/2018/12/06/dont-use-weverything/

Use of -Weverything is based on a misconception about what it is for.  It gives you every warning possible regardless of any other flags, whether it's appropriate to your context or not. Its only known usage is for the development of clang, not development using clang.  Therefore, its use by sorcerer's apprentices is highly discouraged.

I'm willing to become a code contributor if that's what it takes to change this to -Wall.

-pat


Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: oBFusCATed on June 19, 2021, 06:31:40 pm
Patches welcome? Defaults are debatable I don't intend to debate them, but I don't intend to change it at the moment.
Title: Re: -Weverything option leads to far too many warnings - is strongly unrecommended
Post by: stahta01 on June 19, 2021, 07:25:58 pm
https://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker) (https://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker))

Tim S.