News for hackers. Stuff that matters.
Re:Useful GCC warning options not enabled by -Wall -Wextra by ishtu on Wednesday October 04, 2017 @11:19AM (#15401081)
Clang (since LLVM version 4.4) has flag -Weverything which really reports everything

https://www.bignerdranch.com/blog/a-bit-on-warnings/

Re:Useful GCC warning options not enabled by -Wall -Wextra by cpeterso on Wednesday October 04, 2017 @12:34PM (#15401715)
clang doesn't document the full list of warning flags that it supports, but the clang source code has a list, including the hierarchy of meta flags that enable other flags:

https://github.com/llvm-mirror/clang/blob/master/include/cla...

http://fuckingclangwarnings.com/ has descriptions of many of the warnings, but more recent warnings aren't covered because the website hasn't been updated since 2014.

Re:Useful GCC warning options not enabled by -Wall -Wextra by zmodem on Wednesday October 04, 2017 @02:23PM (#15402910)
Re:Useful GCC warning options not enabled by -Wall -Wextra by cpeterso on Thursday October 05, 2017 @02:26AM (#15407001)
Thank you! I've never seen that page. It doesn't show up when searching for "clang warnings" in DuckDuckGo or Bing, but I see now that it is Google's result #2.

I just found a GitHub repo that lists which warning flags are supported by different versions of clang and gcc:

https://github.com/Barro/compiler-warnings

Re:Useful GCC warning options not enabled by -Wall -Wextra by spc476 on Wednesday October 04, 2017 @05:30PM (#15404880)
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?

Re:Useful GCC warning options not enabled by -Wall -Wextra by userbinator on Wednesday October 04, 2017 @10:36PM (#15406381)
There 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".

Re:Useful GCC warning options not enabled by -Wall -Wextra by Too on Thursday October 05, 2017 @12:46AM (#15406726)
I 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.

Re:Useful GCC warning options not enabled by -Wall -Wextra by 2trill2spill on Wednesday October 04, 2017 @06:40PM (#15405361)
Then turn off that warning if you don't like/want it.
Re:Useful GCC warning options not enabled by -Wall -Wextra by spc476 on Wednesday October 04, 2017 @07:40PM (#15405730)
The 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.
Re:Useful GCC warning options not enabled by -Wall -Wextra by jordigh on Wednesday October 04, 2017 @12:35PM (#15401717)
I'm not convinced I want Scott Meyers yelling at me with -Weverything as part of -Weffc++. I think I side with the gcc devs here on not having a flag to enable every possible warning ever.
Re:Useful GCC warning options not enabled by -Wall -Wextra by bennofs on Wednesday October 04, 2017 @12:55PM (#15401892)
You can just use `-Weverything -Wno-effc++` then
Re:Useful GCC warning options not enabled by -Wall -Wextra by 2trill2spill on Wednesday October 04, 2017 @06:42PM (#15405378)
Why not have the flag and not use it if you don't want it? That way other users of gcc who want that flag are not deprived of that feature.