as discussed in #17344
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).
This is a backport of core#19015
Disable -Wduplicated-branches for secp256k1, because of some exotic intentional use of ternary operator duplicated branches in test_inverse_scalar.