]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/{rgw,rgw_gc,otp}: Make use of VLAs an error 68014/head
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 11 Mar 2025 21:43:44 +0000 (17:43 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 26 Mar 2026 04:07:21 +0000 (00:07 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/cls/CMakeLists.txt

index f311b6ef3a0f5db59bbe69196ffb84f1a4802408..ad5c71c51b6d518eb18251727c9265d26f8073c2 100644 (file)
@@ -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
+      $<$<COMPILE_LANGUAGE:CXX>:-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
+      $<$<COMPILE_LANGUAGE:CXX>:-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
+      $<$<COMPILE_LANGUAGE:CXX>:-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
+      $<$<COMPILE_LANGUAGE:CXX>:-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
+      $<$<COMPILE_LANGUAGE:CXX>:-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
+      $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+  endif()
 endif (WITH_RADOSGW)