Enable some commonly enabled compiler diagnostics as discussed in #17344.
Compiler diagnostic | no# of emitted unique GCC warnings in master |
no# of emitted unique Clang warnings in master |
---|---|---|
-Wduplicated-branches : Warn if if /else branches have duplicated code |
0 | Not supported |
-Wduplicated-cond : Warn if if /else chain has duplicated conditions |
0 | Not supported |
-Wlogical-op : Warn about logical operations being used where bitwise were probably wanted |
0 | Not supported |
-Woverloaded-virtual : Warn if you overload (not override ) a virtual function |
0 | 0 |
-Wunused-member-function : Warn on unused member function |
Not supported | 2 |
-Wunused-template : Warn on unused template |
Not supported | 1 |
There is a large overlap between this list and Jason Turner’s list of recommended compiler diagnostics in the Collaborative Collection of C++ Best Practices (cppbestpractices
) project. There is also an overlap with the recommendations given in the C++ Core Guidelines (with editors Bjarne Stroustrup and Herb Sutter).
Closes #17344.