News for hackers. Stuff that matters.
Re:Useful GCC warning options not enabled by -Wall -Wextra by jerf on Wednesday October 04, 2017 @11:44AM (#15401301)
Honest question: Are these warnings smart enough to fire only against "raw" source code? Many of the first few I could see happening from macro expansion and it would be nice to just let those go without warning and let the optimizations hopefully pick up the pieces. Or is that some of the false positives these bring up that were referenced?
Re:Useful GCC warning options not enabled by -Wall -Wextra by Ded7xSEoPKYNsDd on Wednesday October 04, 2017 @11:58AM (#15401438)
Unless you enable -Wsystem-headers, GCC doesn't warn about things in system headers, so for noisy headers it's easiest to mark them as such (with -isystem <dir>).
Re:Useful GCC warning options not enabled by -Wall -Wextra by mrich on Wednesday October 04, 2017 @12:06PM (#15401496)
clang implements it that way, most (all?) warnings from macro expansion are omitted. Maybe gcc does the same for some warnings, but I've only noticed it for clang.

I find clang's behavior particularly dangerous for warnings referring to removal of null pointer checks, which are undefined behavior (if (this != nullptr)...)

There should perhaps be an option to control this.