Enable unused member function diagnostic by default.
Clang has a nice compiler diagnostic -Wunused-member-function
which is good at catching accidentally dead/unreachable code.
While dead/unreachable code is most often harmless from a security/robustness perspective there are instances where dead/unreachable code may be an indication of more serious issues. Enabling this diagnostic allows us to find such cases and reason about which is which.
See concept ACKs for enabling this diagnostic in #19015.
Current warnings in master
that would need to be addressed when enabling this diagnostic:
0index/blockfilterindex.cpp:54:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function]
1script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
Useful skills:
Basic understanding of C++. See #19015 for an example on how to enable a compiler diagnostic by editing configure.ac
.
Want to work on this issue?
For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.