Skip to content

Commit

Permalink
fix: ignore -Wgnu-zero-variadic-macro-arguments on clang
Browse files Browse the repository at this point in the history
  • Loading branch information
J-M0 committed Nov 29, 2024
1 parent d84c495 commit 47b8c14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pybind11/setup_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
if WIN:
cflags += ["/EHsc", "/bigobj"]
else:
cflags += ["-fvisibility=hidden"]
cflags += ["-fvisibility=hidden", "-Wno-gnu-zero-variadic-macro-arguments"]
env_cflags = os.environ.get("CFLAGS", "")
env_cppflags = os.environ.get("CPPFLAGS", "")
c_cpp_flags = shlex.split(env_cflags) + shlex.split(env_cppflags)
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ function(pybind11_enable_warnings target_name)
if(DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD VERSION_LESS 20)
target_compile_options(${target_name} PRIVATE -Wpedantic)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${target_name} PRIVATE -Wno-gnu-zero-variadic-macro-arguments)
endif()
endif()

if(PYBIND11_WERROR)
Expand Down

0 comments on commit 47b8c14

Please sign in to comment.