Skip to content

Conversation

kou
Copy link
Member

@kou kou commented Aug 8, 2025

Client: cpp

We can reproduce these warnings by:

CC=clang CXX=clang++ \
  cmake \
    -S . \
    -B ../thrift.build \
    -DWITH_{AS3,JAVA,JAVASCRIPT,NODEJS,PYTHON,C_GLIB}=OFF \
    -DCMAKE_CXX_FLAGS="-Wgnu-zero-variadic-macro-arguments"
cmake --build ../thrift.build

Sample warning:

lib/cpp/src/thrift/TLogging.h:119:13: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
  119 |             ##__VA_ARGS__);                                                                        \
      |             ^
  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
    • It already exists.
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
    • T_DEBUG("...") is rejected by this change. We need to use T_DEBUG("%s", "...") instead.
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Client: cpp

We can reproduce these warnings by:

    CC=clang CXX=clang++ \
      cmake \
        -S . \
        -B ../thrift.build \
        -DWITH_{AS3,JAVA,JAVASCRIPT,NODEJS,PYTHON,C_GLIB}=OFF \
        -DCMAKE_CXX_FLAGS="-Wgnu-zero-variadic-macro-arguments"
    cmake --build ../thrift.build

Sample warning:

    lib/cpp/src/thrift/TLogging.h:119:13: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
      119 |             ##__VA_ARGS__);                                                                        \
          |             ^
@Jens-G Jens-G added the c++ label Aug 20, 2025
@Jens-G
Copy link
Member

Jens-G commented Aug 20, 2025

I'm not so sure about this one. Introducing a breaking change (per JIRA label) and looking at the considerations behind (e.g. this SO thread to name just one) that looks to me like a simple but effective way to introduce funny issues.

@kou
Copy link
Member Author

kou commented Aug 21, 2025

OK. Are you interested in suppressing this warning? If so, I'll look into another approach that doesn't introduce any backward compatibility.
(In the implementation, `T_DEBUG("...") is rejected.)

If you aren't interested in suppressing this warning, I close this. (Should we close https://issues.apache.org/jira/browse/THRIFT-3268 too?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants