[BUG]: token pasting of ',' and __VA_ARGS__ is a GNU extension / pedantic warnings #5310
Closed
2 of 3 tasks
Labels
triage
New bug, unverified
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.13.3
Problem description
The most recent release uses
, ##__VA_ARGS__
incommon.h
. This is not technically in the standard (see e.g. here), but most compilers support it. Clang, however, complains about its use when setting-Wpedantic
. I can work around this by either not passing-Wpedantic
, or passing-Wno-gnu-zero-variadic-macro-arguments
, but I'd rather not do that if it can at all be avoided.Consider the attached example,
test.cpp
. Compiling it withclang -Wall -Wextra -Wpedantic -Werror -shared -std=c++20 -fPIC $(python -m pybind11 --includes) test.cpp -o test.so
produces the following:
It concerns the following code snippet:
pybind11/include/pybind11/detail/common.h
Lines 493 to 494 in fc97cc4
I am not sure if pybind needs to consider this a bug or even an issue. But the previous versions of pybind (2.12 and below) worked without a hitch when setting the
-Wpedantic
option, so I figured I'd let you know about this here.Reproducible example code
Is this a regression? Put the last known working version here if it is.
2.12.0
The text was updated successfully, but these errors were encountered: