diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-09-19 11:10:14 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-01 00:44:53 +0200 |
commit | d54f252497a0278ad709a97fb63bd745e132cc89 (patch) | |
tree | 23a8ab1fce22b9de709790585087e86f4cb5830d | |
parent | 71ddf37a17ea1fd6b8f7044a1fe32ce4e8559ef3 (diff) | |
download | sparse-d54f252497a0278ad709a97fb63bd745e132cc89.tar.gz |
flex-array: detect structures with a flexible array member
This is a preparatory step for doing the checks and warnings.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | symbol.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -87,6 +87,7 @@ struct struct_union_info { unsigned long max_align; unsigned long bit_size; int align_size; + struct symbol *flex_array; }; /* @@ -128,6 +129,7 @@ static void lay_out_struct(struct symbol *sym, struct struct_union_info *info) if (!is_array_type(sym)) return; base_size = 0; + info->flex_array = sym; } align_bit_mask = bytes_to_bits(sym->ctype.alignment) - 1; |