In addition to the well-known -Wall
, clang offers another interesting warning flag: -Weverything
. While it sounds like a “strictly better” option (the more warnings, the better?) it’s not.
This topic is already well covered by Arthur O’Dwyer’s blog post and the clang documentation.
Arthur makes a strong case against use of this flag. The clang docs generally agree, though offering a slightly more lenient position:
If you do use
-Weverything
then we advise that you address all new compiler diagnostics as they get added to Clang, either by fixing everything they find or explicitly disabling that diagnostic with its corresponding Wno- option.
But what I have not seen clearly expressed is how use of -Weverything
is a tradeoff.