]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/rgw: Fix clang compiler warnings.
authorAlex Ainscow <aainscow@uk.ibm.com>
Mon, 6 Oct 2025 09:43:26 +0000 (10:43 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Mon, 6 Oct 2025 09:47:30 +0000 (10:47 +0100)
These fixes address compiler warnings that may only be present in
clang builds.

In RGW, the problem is a warning not implemented in clang. Despite
apparantly being a GCC-specific pragma, clang actually attempts to
honour the progma and "helpfully" warns that it did not work.

In crimson, the changes to store bench are following the recommended
action in the warning produced by clang.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
src/crimson/tools/store_bench/store-bench.cc
src/rgw/rgw_s3select_private.h

index 612bf8356d9c89158a4789e282422e38de0f8bfb..18fe9af9d5f429bddc3f54d01b888e8135e7dc4d 100644 (file)
@@ -121,7 +121,7 @@ public:
 };
 
 
-class PGLogWorkload : public StoreBenchWorkload {
+class PGLogWorkload final : public StoreBenchWorkload {
   unsigned num_logs = 4;
   unsigned log_size = 1024;
   unsigned log_length = 256;
@@ -146,7 +146,7 @@ public:
   ~PGLogWorkload() final {}
 };
 
-class RGWIndexWorkload : public StoreBenchWorkload {
+class RGWIndexWorkload final : public StoreBenchWorkload {
   unsigned num_indices = 16;
   uint64_t key_size = 1024;
   uint64_t value_size = 1024;
@@ -581,7 +581,7 @@ seastar::future<results_t> RGWIndexWorkload::run(
  *
  * Performs a simple random write workload.
  */
-class RandomWriteWorkload : public StoreBenchWorkload {
+class RandomWriteWorkload final : public StoreBenchWorkload {
   uint64_t prefill_size = 128<<10;
   uint64_t io_size = 4<<10;
   uint64_t size_per_shard = 64<<20;
index d2eef3ce8d12370ad73f888d3bdae999daf5073c..ec88978816de492830ae5e22f34cd832502797f0 100644 (file)
 #pragma GCC diagnostic push
 #pragma clang diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated"
+#if defined(__GNUC__) && !defined(__clang__)
+// Clang generates a warning due to this (-Wunknown-warning-option)
 #pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
 #pragma clang diagnostic ignored "-Wdeprecated"
 #include <s3select/include/s3select.h>
 #pragma GCC diagnostic pop