From: Alex Ainscow Date: Mon, 6 Oct 2025 09:43:26 +0000 (+0100) Subject: crimson/rgw: Fix clang compiler warnings. X-Git-Tag: testing/wip-vshankar-testing-20251027.053005-debug~84^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec2923adde43e7b1cc6a0a8328d612542e4b7bfb;p=ceph-ci.git crimson/rgw: Fix clang compiler warnings. 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 --- diff --git a/src/crimson/tools/store_bench/store-bench.cc b/src/crimson/tools/store_bench/store-bench.cc index 612bf8356d9..18fe9af9d5f 100644 --- a/src/crimson/tools/store_bench/store-bench.cc +++ b/src/crimson/tools/store_bench/store-bench.cc @@ -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 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; diff --git a/src/rgw/rgw_s3select_private.h b/src/rgw/rgw_s3select_private.h index d2eef3ce8d1..ec88978816d 100644 --- a/src/rgw/rgw_s3select_private.h +++ b/src/rgw/rgw_s3select_private.h @@ -35,7 +35,10 @@ #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 #pragma GCC diagnostic pop