-
Notifications
You must be signed in to change notification settings - Fork 37.7k
tracepoints: Disables -Wgnu-zero-variadic-macro-arguments
to compile without warnings
#27401
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
tracepoints: Disables -Wgnu-zero-variadic-macro-arguments
to compile without warnings
#27401
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
Maybe add a check to |
…e without warnings Fixes bitcoin#26916 by disabling the warning `-Wgnu-zero-variadic-macro-arguments` when clang is used as the compiler.
240e513
to
5197660
Compare
Sounds good, but I have no idea how to do this with |
Concept ACK and thank you for looking into this! I would include this in #26593 (e.g. with #26593 (comment)) too. If #26916 is blocking something (e.g. switching to a newer clang) I think merging this PR here first should be preferred as #26593 is a bigger change that might take a bit longer. |
Something like in this branch: --- a/configure.ac
+++ b/configure.ac
@@ -470,6 +470,19 @@ if test "$CXXFLAGS_overridden" = "no"; then
if test "$suppress_external_warnings" != "yes" ; then
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"], [], [$CXXFLAG_WERROR])
fi
+
+ AX_CHECK_COMPILE_FLAG([-Wgnu-zero-variadic-macro-arguments],
+ [
+ TEMP_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-Wgnu-zero-variadic-macro-arguments $CXXFLAG_WERROR $CXXFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #define VARIADIC_MACRO(a, ...) f(__VA_ARGS__)
+ void f() {}
+ int main() { VARIADIC_MACRO(42); }
+ ]])], [],
+ [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-gnu-zero-variadic-macro-arguments"])
+ CXXFLAGS="$TEMP_CXXFLAGS"
+ ], [], [$CXXFLAG_WERROR])
fi
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review. |
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 Manually setting that flag by overriding CXXFLAGS disables a whole bunch of debugging warnings, so handling it directly seems very helpful. |
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 5197660 - checked that this fixes the warnings under Clang.
…-arguments` to compile without warnings 5197660 tracepoints: Disables `-Wgnu-zero-variadic-macro-arguments` to compile without warnings (Martin Leitner-Ankerl) Pull request description: Fixes bitcoin#26916 by disabling the warning `-Wgnu-zero-variadic-macro-arguments` when clang is used as the compiler. Also see the comments * Proposed changes in the bug bitcoin#26916 (comment) * Proposed changes when moving to a variadic maro: bitcoin#26593 (comment) ACKs for top commit: hebasto: ACK 5197660, I've reconsidered my [comment](bitcoin#27401 (comment)) and I think the current localized approach is optimal. fanquake: ACK 5197660 - checked that this fixes the warnings under Clang. Tree-SHA512: c3dda3bcbb2540af6283ffff65885a9937bfdaaef3b00dc7d60b9f9740031d5c36ac9cb3d3d8756dbadce4812201a9754f5b8770df0d5e0d5ee690ba8a7135d2
Fixes #26916 by disabling the warning
-Wgnu-zero-variadic-macro-arguments
when clang is used as the compiler.Also see the comments