-
Notifications
You must be signed in to change notification settings - Fork 1k
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
cmake: Fix checking compiler flags like -Wno-some-warning
#1332
base: master
Are you sure you want to change the base?
Conversation
Is this currently an issue for anything? If the check is broken, then it should be fixed before we start using it. |
I think noone has run into this so far, but yeah, we should fix it. Concept ACK |
cmake/TryAppendCFlags.cmake
Outdated
# Some compilers (GCC) produce no diagnostic for -Wno-unknown-warning | ||
# unless other diagnostics are being produced. Therefore, test the | ||
# -Wsome-warning case instead of the -Wno-some-warning one. |
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.
# Some compilers (GCC) produce no diagnostic for -Wno-unknown-warning | |
# unless other diagnostics are being produced. Therefore, test the | |
# -Wsome-warning case instead of the -Wno-some-warning one. | |
# Some compilers (GCC) produce no diagnostic for -Wno-some-warning, | |
# if "some-warning" is unknown to the compiler and no other diagnostics are being produced. | |
# Therefore, test the | |
# -Wsome-warning case instead of the -Wno-some-warning one. |
Modulo paragraph formatting.
This confused me a lot because I thought -Wno-unknown-warning
is a real flag that says "Don't warn on unknown warnings flags". (Clang has a real flag -Wno-unknown-warning-option
for this!)
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.
Thanks! Reworked.
The newest current option--
The PR description mentions two checks, one per build system. The check in the Autotools-based build system: secp256k1/build-aux/m4/bitcoin_secp.m4 Lines 64 to 78 in a526937
The check in the CMake-based build system mirrored the behaviour of its Autotools' counterpart. Therefore, both checks need to be fixed. |
Some compilers (GCC) produce no diagnostic for
-Wno-some-warning
unless other diagnostics are being produced:This PR fixes compiler flag check in CMake-based build system.
Let me know, if the same fix is desirable in Autotools-based build system.