Skip to content

Commit 238feec

Browse files
krylosov-aaleborchuk
authored andcommitted
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: #1677
1 parent 02a5603 commit 238feec

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎contrib/pax_storage/src/cpp/storage/proto/proto_wrappers.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,19 @@
3535
#undef Min
3636
#undef Max
3737
#undef IsPowerOf2
38+
39+
// GCC 14 emits false -Warray-bounds warnings in protobuf 3.19 headers.
40+
#if defined(__GNUC__) && !defined(__clang__)
41+
#pragma GCC diagnostic push
42+
#pragma GCC diagnostic ignored "-Warray-bounds"
43+
#endif
3844
#include "storage/proto/micro_partition_stats.pb.h"
3945
#include "storage/proto/orc_proto.pb.h"
4046
#include "storage/proto/pax.pb.h"
47+
#if defined(__GNUC__) && !defined(__clang__)
48+
#pragma GCC diagnostic pop
49+
#endif
50+
4151
#define FATAL 22
4252
#define Min(x, y) ((x) < (y) ? (x) : (y))
4353
#define Max(x, y) ((x) > (y) ? (x) : (y))

0 commit comments

Comments
 (0)