This is split from #21667.
For users, one of the preferred ways to use the Bitcoin Core client is compiling from source, either downloaded as a part of release or acquired via git.
Only basic knowledge about terminal is required to run:
0$ cd bitcoin
1$ ./autogen.sh
2$ ./configure
3$ make check
Also, it is natural to expect that number of users that have such knowledge is higher than the number of advanced users or developers.
Assuming the basic knowledge level of users it seems unwise to allow compiler and linker warnings because they could undermine the users’ trust in the Bitcoin Core quality/security/reliability.
Of course, warnings could be emitted by different parts of code: either the code we are responsible for, or third parties code, including sub-trees in our repo:
and other dependencies:
- https://github.com/libevent/libevent
- https://github.com/boostorg/boost
- https://github.com/qt/qtbase
- …
Currently, warnings from leveldb
are suppressed unconditionally: https://github.com/bitcoin/bitcoin/blob/599000903e09e5ae3784d15ae078a2e1ed89ab12/src/Makefile.leveldb.include#L39
OTOH, warnings from Qt and Boost code could be suppressed with the --enable-suppress-external-warnings
configure option.
Making the --enable-suppress-external-warnings
the default has the following benefits:
- don’t alarm users who compile from source
- increase signal/noise ratio for developers when a new warning appears in our code (as an example, Qt warnings on macOS, where Homebrew’s Qt is pretty fresh)
- allows to apply more
-W
and-Werror
options by default (for example,-Wdocumentation
and-Werror=documentation
introduced in #21613)
There was an objection:
I don’t think we should make
--enable-suppress-external-warnings
the default, but it should be better documented. Someone needs to be motivated to fix things upstream and/or notice problems when we update dependencies.
The answer to this objection is that fixing “things upstream” is not the top priority for developers. It is always possible to build with the --disable-suppress-external-warnings
. Even more, with this PR the --disable-suppress-external-warnings
will reveal leveldb
warning as well.