3 ms·
I found -Weverything seriously annoying. Declare a structure, and clang warns about padding bytes being added. Make it a packed structure, and clang warns abo
by spc476 9y ago
I found -Weverything seriously annoying. Declare a structure, and clang warns about padding bytes being added. Make it a packed structure, and clang warns about the lack of padding bytes. Useless! Okay, I can see the warning on packed structures, as that's usually a compiler extension, but a plain struct?
Seriously?
- 2trill2spill 9y agoThen turn off that warning if you don't like/want it.
- spc476 9y agoThe point is there's a warning either way. Pack the structure, and you get warnings. Don't pack the structure, get warnings. To me, that's being needlessly pedantic.
- userbinator 9y agoThere is also -Wlogical-op-parentheses, which rather condescendingly implies that you don't know the precedence of || vs &&. (The main use of parentheses is specifically to indicate precedence different from the usual, since otherwise they just add noise to the code and reduce clarity.) I half-expect -Warithmetic-op-parentheses or even -Wop-parentheses to show up in some future version of clang... Unfortunately there's no corresponding -Wuseless-parentheses, which if present would truly make -Weverything a "damned if you do, damned if you don't".
- Too 9y agoI think clang added a -Weverything just to prove a point why it's a bad idea to actually contain _all_ warnings in -Wall. As you say, some warnings are contradictory and it's up to the project to decide which one of them is more important.