From be0d5ce45ef2db35ea6b5f0841aded1b324f5c8d Mon Sep 17 00:00:00 2001 From: krylosov-aa Date: Fri, 11 Sep 2026 00:25:29 +0300 Subject: [PATCH] Fix PAX protobuf array bounds warnings Suppress false GCC 14 array bounds warnings in protobuf 3.19 headers. Limit the suppression to protobuf includes and restore diagnostics for PAX code. See: https://github.com/apache/cloudberry/issues/1677 --- .../pax_storage/src/cpp/storage/proto/proto_wrappers.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contrib/pax_storage/src/cpp/storage/proto/proto_wrappers.h b/contrib/pax_storage/src/cpp/storage/proto/proto_wrappers.h index 3e57167f334..81422fd79bb 100644 --- a/contrib/pax_storage/src/cpp/storage/proto/proto_wrappers.h +++ b/contrib/pax_storage/src/cpp/storage/proto/proto_wrappers.h @@ -35,9 +35,19 @@ #undef Min #undef Max #undef IsPowerOf2 + +// GCC 14 emits false -Warray-bounds warnings in protobuf 3.19 headers. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif #include "storage/proto/micro_partition_stats.pb.h" #include "storage/proto/orc_proto.pb.h" #include "storage/proto/pax.pb.h" +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #define FATAL 22 #define Min(x, y) ((x) < (y) ? (x) : (y)) #define Max(x, y) ((x) > (y) ? (x) : (y))