-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: optionally skip external warnings #18750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
To test that this works as intended plant some warning in a Qt header (if you don't have already!). For example: inline bool f(int iii, unsigned uuu) { return iii < uuu; } in |
We currently compile our code with some warnings explicitly silenced: Currently Bitcoin Core is free of such warnings, but they can sneak in at anytime completely unnoticed - due to the above flags nobody will notice if a new code introduces such a warning. If this PR gets merged, then we can consider removing the above |
Concept ACK |
Concept ACK. |
Tested on Ubuntu 20.04 LTS (gcc 9.3.0) and macOS 10.15.4 (llvm clang 10.0). Works as expected. I've looked through our docs, and didn't find any compiler warning policy. Or did I miss it? From the POV of a user who respects one's own safety and builds one's own node binaries from the source, I believe there is no a such thing like a "harmless compiler warning". At least for major OSes (the two latest versions of Ubuntu LTS, Debian stable, Fedora, macOS, Windows with default system compilers) on the x86_64 platform. In the worst case, a rare warning should be documented in the release notes. Concept ACK. Is it possible to increase the granularity of |
Excellent!
I agree. This is why the new option is
I did consider this! It would increase the complexity of this feature to some extent, but there is a bigger problem - we suppress warnings based on the directory in which the header which produced the warning is located. So, if both qt and boost are installed in the same directory (e.g. |
Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. Github-Pull: bitcoin#18750 Rebased-From: 1e4e981
Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. Github-Pull: bitcoin#18750 Rebased-From: 1e4e981
1e4e981
to
426e6dc
Compare
Rebased (trivial conflict with the merged #18297). |
426e6dc
to
ec1ea76
Compare
Rebased to resolve conflicts. |
Gitian builds
|
Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot.
3598707
to
ba8950e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ba8950e, tested on Linux Mint 20 (x86_64).
With --enable-suppress-external-warnings
having warnings from leveldb only:
$ make > /dev/null
leveldb/db/c.cc: In function ‘leveldb_filterpolicy_t* leveldb_filterpolicy_create_bloom(int)’:
leveldb/db/c.cc:474:17: warning: ‘virtual const char* leveldb_filterpolicy_create_bloom(int)::Wrapper::Name() const’ can be marked override [-Wsuggest-override]
474 | const char* Name() const { return rep_->Name(); }
| ^~~~
leveldb/db/c.cc:475:10: warning: ‘virtual void leveldb_filterpolicy_create_bloom(int)::Wrapper::CreateFilter(const leveldb::Slice*, int, std::string*) const’ can be marked override [-Wsuggest-override]
475 | void CreateFilter(const Slice* keys, int n, std::string* dst) const {
| ^~~~~~~~~~~~
leveldb/db/c.cc:478:10: warning: ‘virtual bool leveldb_filterpolicy_create_bloom(int)::Wrapper::KeyMayMatch(const leveldb::Slice&, const leveldb::Slice&) const’ can be marked override [-Wsuggest-override]
478 | bool KeyMayMatch(const Slice& key, const Slice& filter) const {
| ^~~~~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK ba8950e
ACK ba8950e: diff looks correct! Really looking forward to having this in |
Thanks for adding this option, it definitely helps reduce the flood of warnings in boost and qt etc. |
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9
* Merge bitcoin#18750: build: optionally skip external warnings ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9 * add --enable-suppress-external-warnings to matrix.sh Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
* Merge bitcoin#18750: build: optionally skip external warnings ba8950e build: optionally skip external warnings (Vasil Dimov) Pull request description: Add an option to `./configure` to suppress compilation warnings from external headers. The option is off by default (no change in behavior, show warnings from external headers). This option is useful if e.g. Boost or Qt is installed outside of `/usr/include` (warnings from headers in `/usr/include` are already suppressed by default) and those warnings stand in the way of compiling Bitcoin Core with `-Werror[=...]` or they just clutter the build output too much and make our own warnings hard to spot. `-isystem /usr/include` bricks GCC's `#include_next`, so we use `-idirafter` instead. This way we don't have to treat `/usr/include` specially. ACKs for top commit: practicalswift: ACK ba8950e: diff looks correct! hebasto: ACK ba8950e, tested on Linux Mint 20 (x86_64). luke-jr: utACK ba8950e Tree-SHA512: 9b54fae8590be6c79f2688a5aca09e0a9067f481dabecdd49bb278c08a62ac2b0cc704c894fbd53240e77ac84da0c7a237845df0a696cfbdb0359e1c8e2e10c9 * add --enable-suppress-external-warnings to matrix.sh Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
Add an option to
./configure
to suppress compilation warnings fromexternal headers. The option is off by default (no change in behavior,
show warnings from external headers).
This option is useful if e.g. Boost or Qt is installed outside of
/usr/include
(warnings from headers in/usr/include
are alreadysuppressed by default) and those warnings stand in the way of compiling
Bitcoin Core with
-Werror[=...]
or they just clutter the build outputtoo much and make our own warnings hard to spot.
-isystem /usr/include
bricks GCC's#include_next
, so we use-idirafter
instead. This way we don't have to treat/usr/include
specially.