From 3491f4fbda1f9c0184b0de5f5e5029f27bf74f23 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 13 Sep 2023 10:48:27 -0400 Subject: [PATCH] Disable zero-variadic-macro-arguments warning when using clang. (#768) * Disable gnu-zero-variadic-macro-arguments warning on clang. Signed-off-by: Chris Lalancette --- rosidl_typesupport_introspection_tests/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rosidl_typesupport_introspection_tests/CMakeLists.txt b/rosidl_typesupport_introspection_tests/CMakeLists.txt index 3b0f1a1dc..a4b3b2313 100644 --- a/rosidl_typesupport_introspection_tests/CMakeLists.txt +++ b/rosidl_typesupport_introspection_tests/CMakeLists.txt @@ -15,6 +15,12 @@ if(BUILD_TESTING) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # When building under Clang, the "TYPED_TEST_SUITE" macros in the tests print the following + # warning: "must specify at least one argument for '...' parameter of variadic macro". + # Since this isn't really a problem, and will be allowed under C++20, just disable the warning. + add_compile_options(-Wno-gnu-zero-variadic-macro-arguments) + endif() find_package(rosidl_cmake REQUIRED) find_package(rosidl_generator_c REQUIRED)