Author Topic: -Weverything option leads to far too many warnings - is strongly unrecommended  (Read 2944 times)

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 71

-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"));


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13408
    • Travis build status
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. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 71
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!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13408
    • Travis build status
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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline callahanp

  • Single posting newcomer
  • *
  • Posts: 1
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


« Last Edit: June 19, 2021, 06:29:16 pm by callahanp »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13408
    • Travis build status
Patches welcome? Defaults are debatable I don't intend to debate them, but I don't intend to change it at the moment.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7151
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org