With C++17 [[maybe_unused]] attribute it is easy to keep emerged cases in the new code under control.
This PR does not touch -Wno-unused-parameter as it requires too much of code churning.
Compiler specific notes:
- clang:
-Wunused-macrosnot added because it requires a non-trivial checking in theconfigurescript, and it blames only https://github.com/bitcoin/bitcoin/blob/a9d1b40d53ec417eefbe767aa66701ef8e1801d5/src/util/system.cpp#L34-Wunused-templatenot added because some of our templates are buried into macros-Wused-but-marked-unusedproduces tones of warnings in boost tests
- gcc
-Werror=unused-const-variablewith level 2 seems not suitable for C++ code