GH-50487: [C++] Extra semicolon warning from ARROW_SUPPRESS_DEPRECATION_WARNING macro with -Wpedantic#50489
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR fixes -Wpedantic warnings caused by empty statements emitted from warning-suppression macros in Arrow C++ headers. It updates cpp/src/arrow/util/macros.h so _Pragma(...) uses no trailing semicolons, preventing “extra ‘;’” warnings at macro expansion sites.
Changes:
- Remove trailing semicolons after
_Pragma(...)in the Clang and GCCARROW_SUPPRESS_DEPRECATION_WARNINGmacro variants. - Remove trailing semicolons after
_Pragma(...)inARROW_SUPPRESS_MISSING_DECLARATIONS_WARNINGfor GCC.
pitrou
left a comment
There was a problem hiding this comment.
I had no idea that it was possible to concatenate pragma statements like this. As long as it passes CI I'm fine with it :)
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 96d8eb1. There were 2 benchmark results indicating a performance regression:
The full Conbench report has more details. It also includes information about 117 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
When building Arrow 25.0.0 from source and then building the R package, we see:
The
ARROW_SUPPRESS_DEPRECATION_WARNINGandARROW_SUPPRESS_MISSING_DECLARATIONS_WARNINGmacros have trailing semicolons after_Pragmadirectives, which produce empty statements and trigger-Wpedanticwarnings wherever the macros are used.What changes are included in this PR?
Remove unnecessary semicolons after
_Pragmacalls in the clang, GCC, and missing-declarations macro variants inmacros.h.Are these changes tested?
Existing tests cover these macros. The change only removes empty statements.
Are there any user-facing changes?
No.