mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-30 00:27:30 +03:00
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:
parent
295e48944b
commit
300b58b49b
1 changed files with 4 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue