Don’t put -Weverything in your build flags (2018)
15 points by hwj
15 points by hwj
Begs the question, if there is a warning that is a bad idea, why is it supported
The article explains that it’s helpful for discovering warnings that you might want to enable.
One thing it doesn’t mention, which I think has changed since the article was written, is that -Weverything now includes mutually-contradictory warnings, so it isn’t possible to have a warning-free build with -Weverything.
The article explains that it’s helpful for discovering warnings that you might want to enable.
Right, my question is if there are any warnings that are not a good idea to turn on, why do they exist? Like, what warnings are making using -Weverything
a bad idea? Relatedly, why are there contradictory warnings? @_@
Several warnings contradict each other because they let you choose different ways of doing things (e.g warning that says “default branch when all enum cases are covered” vs warning that says “no default branch”, depending on whether you wish to assume your enum inputs are valid).
Also, many warnings simply aren’t relevant to all projects, e.g you may want to use language extensions so -Wlanguage-extension-token
is not needed, same with -Wpre-c11-compat
, etc
I’d note that -Weverything even has warnings that conflict with each other…
The article also has a citation that mentions that.