From: Jon Bailey Date: Thu, 26 Feb 2026 17:06:03 +0000 (+0000) Subject: test: Fix gcc warnings about subobject-linkage in ceph_test_rados_io_sequence X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2e4a7e9bd2f4590f193ce1f1d3029d1a27253e47;p=ceph.git test: Fix gcc warnings about subobject-linkage in ceph_test_rados_io_sequence 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 --- diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h index 3d8f5e71e184..54274ca35556 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h @@ -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, object_size_array_size> +inline constexpr std::array, 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 block_size_choices = { +inline constexpr std::array 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 block_size_choices_stable = { +inline constexpr std::array 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 thread_count_choices = { +inline constexpr std::array 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 +inline constexpr std::array plugin_choices = {{"jerasure", "isa", "clay", "shec", "lrc"}}; inline static constexpr int plugin_array_size_stable = 2; -inline static constexpr std::array +inline constexpr std::array plugin_choices_stable = {{"jerasure", "isa"}}; using SelectErasurePlugin =