]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Fix gcc warnings about subobject-linkage in ceph_test_rados_io_sequence 67553/head
authorJon Bailey <jonathan.bailey1@ibm.com>
Thu, 26 Feb 2026 17:06:03 +0000 (17:06 +0000)
committerJon Bailey <jonathan.bailey1@ibm.com>
Thu, 26 Feb 2026 17:06:03 +0000 (17:06 +0000)
In gcc, you get warnings for subobject-linkage in ceph_test_rados_io_sequence. This is because we have static arrays inside a namespace, which means we are restricting that variable's use to only within the translation unit (internal linkage). The warnings are telling us that we are using these variables in classes we have defined in the header file, which have the possibility of being used outside of the translation unit. This happens because we are using some of these static variables as template parameters that we are passing by reference, and then those templates are being stored by some of our classes for use.

I would like these classes to have the possibility to be usable outside of this translation unit, so the fix here is just to remove the static. These variables are marked as inline, which when static is not present means they are visible outside of the translation unit, which means the warning no longer shows.

Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h

index 3d8f5e71e184edff95f55b35069bc6a92a9fc0e1..54274ca35556f66effc79f4dd941e6e6ab913e44 100644 (file)
@@ -85,7 +85,7 @@ namespace io_sequence {
 namespace tester {
 // Choices for min and max object size
 inline static constexpr size_t object_size_array_size = 10;
-inline static constexpr std::array<std::pair<int, int>, object_size_array_size>
+inline constexpr std::array<std::pair<int, int>, object_size_array_size>
     object_size_choices = {{{1, 32},  // Default - best for boundary checking
                           {12, 14},
                           {28, 30},
@@ -104,13 +104,13 @@ using SelectObjectSize =
 
 // Choices for block size
 inline static constexpr int block_size_array_size = 5;
-inline static constexpr std::array<uint64_t, block_size_array_size> block_size_choices = {
+inline constexpr std::array<uint64_t, block_size_array_size> block_size_choices = {
     {2048,  // Default - test boundaries for EC 4K chunk size
      512, 3767, 4096, 32768}};
 
 // Choices for block size
 inline static constexpr int block_size_array_size_stable = 2;
-inline static constexpr std::array<uint64_t, block_size_array_size_stable> block_size_choices_stable = {
+inline constexpr std::array<uint64_t, block_size_array_size_stable> block_size_choices_stable = {
   {2048,  // Default - test boundaries for EC 4K chunk size
    32768}};
 
@@ -124,7 +124,7 @@ using SelectBlockSize =
 
 // Choices for number of threads
 inline static constexpr int thread_array_size = 4;
-inline static constexpr std::array<int, thread_array_size> thread_count_choices = {
+inline constexpr std::array<int, thread_array_size> thread_count_choices = {
     {1,  // Default
      2, 4, 8}};
 
@@ -144,11 +144,11 @@ class SelectSeqRange
 
 // Choices for plugin
 inline static constexpr int plugin_array_size = 5;
-inline static constexpr std::array<std::string_view, plugin_array_size>
+inline constexpr std::array<std::string_view, plugin_array_size>
     plugin_choices = {{"jerasure", "isa", "clay", "shec", "lrc"}};
 
 inline static constexpr int plugin_array_size_stable = 2;
-inline static constexpr std::array<std::string_view, plugin_array_size_stable>
+inline constexpr std::array<std::string_view, plugin_array_size_stable>
     plugin_choices_stable = {{"jerasure", "isa"}};
 
 using SelectErasurePlugin =