[cfe-dev] Why is -Wshadow not in -Wextra?

Christopher Jefferson chris at bubblescope.net
Tue Nov 6 13:57:01 PST 2012


Sorry if this is a stupid, or FAQ, but I couldn't find it written down anywhere.

After spending some time tracking down an annoying bug where I was
redeclaring a local variable inside a scope, I was suprised to realise
that -Wshadow is not included in -Wextra (or possibly even -Wall). It
seems like a sensible error message, personally I try to avoid all
shadowing.

Is there some reasoning behind what goes into -Wextra? I certainly
have never gone looking for flags which aren't in -Wextra, and expect
it to cover everything "sensible". I suppose people may differ on
"sensible"!

Chris



More information about the cfe-dev mailing list