arena_s: Replace bin_t all_bins[0] by [] for C99 or newer

Zero-sized arrays are not allowed by ISO C.
C99 introduced a way to express this.
Type-checking fails, because all_bins is asigned malloced
storage of length > 0.
Found by GCC and Clang (-Wpedantic).
This commit is contained in:
Christoph Grüninger 2026-05-09 12:49:50 +02:00 committed by Slobodan Predolac
parent 295e48944b
commit 300b58b49b

View file

@ -104,7 +104,11 @@ struct arena_s {
"Do not use this field directly. "
"Use `arena_get_bin` instead.")
JEMALLOC_ALIGNED(CACHELINE)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
bin_t all_bins[];
#else
bin_t all_bins[0];
#endif
};
#endif /* JEMALLOC_INTERNAL_ARENA_STRUCTS_H */