Skip to content
Snippets Groups Projects
Commit 9b0278f4 authored by Artem Starshov's avatar Artem Starshov Committed by Kirill Yukhin
Browse files

bitset: replace zero-length array with flexible-array member

Zero-lenght arrays are GNU C extension.
There's ISO C99 flexible array member, which
is preffered mechanism to declare variable-length types.

Flexible array member allows us to avoid applying sizeof
operator cause it's incomplete type, so it will be an error
at compile time. There're any moments else why it's better
way to implement such structures via FAM:
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

In this issue it fixed gcc 10 warning:
"warning: writing 1 byte into
a region of size 0 [-Wstringop-overflow=]"

Closes #4966
Closes #5564
parent a65d9c50
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ struct tt_bitset_page {
size_t first_pos;
rb_node(struct tt_bitset_page) node;
size_t cardinality;
uint8_t data[0];
uint8_t data[];
};
typedef rb_tree(struct tt_bitset_page) tt_bitset_pages_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment