From: Adam C. Emerson Date: Tue, 11 Mar 2025 21:43:44 +0000 (-0400) Subject: cls/{rgw,rgw_gc,otp}: Make use of VLAs an error X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=74880568bc7ffced0971dad9807ebe2a9eee8025;p=ceph.git cls/{rgw,rgw_gc,otp}: Make use of VLAs an error Signed-off-by: Adam C. Emerson --- diff --git a/src/cls/CMakeLists.txt b/src/cls/CMakeLists.txt index f311b6ef3a0f..ad5c71c51b6d 100644 --- a/src/cls/CMakeLists.txt +++ b/src/cls/CMakeLists.txt @@ -81,12 +81,20 @@ if (WITH_RADOSGW) INSTALL_RPATH "" CXX_VISIBILITY_PRESET hidden) install(TARGETS cls_otp DESTINATION ${cls_dir}) + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_otp PRIVATE + $<$:-Werror=vla>) + endif() set(cls_otp_client_srcs otp/cls_otp_client.cc otp/cls_otp_types.cc ) add_library(cls_otp_client STATIC ${cls_otp_client_srcs}) + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_otp_client PUBLIC + $<$:-Werror=vla>) + endif() endif (WITH_RADOSGW) # cls_refcount @@ -206,6 +214,10 @@ if (WITH_RADOSGW) SOVERSION "1" INSTALL_RPATH "" CXX_VISIBILITY_PRESET hidden) + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_rgw PRIVATE + $<$:-Werror=vla>) + endif() install(TARGETS cls_rgw DESTINATION ${cls_dir}) set(cls_rgw_client_srcs @@ -216,6 +228,10 @@ if (WITH_RADOSGW) target_include_directories(cls_rgw_client PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/driver/rados" PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw") + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_rgw_client PUBLIC + $<$:-Werror=vla>) + endif() endif (WITH_RADOSGW) @@ -313,6 +329,10 @@ if (WITH_RADOSGW) SOVERSION "1" INSTALL_RPATH "" CXX_VISIBILITY_PRESET hidden) + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_rgw_gc PRIVATE + $<$:-Werror=vla>) + endif() install(TARGETS cls_rgw_gc DESTINATION ${cls_dir}) set(cls_rgw_gc_client_srcs @@ -322,6 +342,10 @@ if (WITH_RADOSGW) target_include_directories(cls_rgw_gc_client PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/driver/rados" PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw") + if(COMPILER_SUPPORTS_VLA_ERROR) + target_compile_options(cls_rgw_gc_client PUBLIC + $<$:-Werror=vla>) + endif() endif (WITH_RADOSGW)