HomePhabricator

build: Enable some commonly enabled compiler diagnostics

Description

build: Enable some commonly enabled compiler diagnostics

Summary:

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.

Test Plan:

cmake .. -GNinja -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_C_FLAGS=-Werror
ninja && ninja check && ninja check-secp256k1
rm -Rf *
cmake .. -GNinja  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-Werror  -DCMAKE_C_FLAGS=-Werror
ninja && ninja check && ninja check-secp256k1

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10113

Details

Provenance
PiRKAuthored on Sep 14 2021, 14:44
PiRKPushed on Sep 15 2021, 06:52
Reviewer
Restricted Project
Differential Revision
D10113: build: Enable some commonly enabled compiler diagnostics
Parents
rABC5805c6432100: Move only: Move CDiskTxPos to its own file
Branches
Unknown
Tags
Unknown