diff mbox series

[05/13] flex-array: detect structures with a flexible array member

Message ID 20200930231828.66751-6-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series add warnings for flexible arrays | expand

Commit Message

Luc Van Oostenryck Sept. 30, 2020, 11:18 p.m. UTC
This is a preparatory step for doing the checks and warnings.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/symbol.c b/symbol.c
index 9acffeea7fad..6633e89de4a9 100644
--- a/symbol.c
+++ b/symbol.c
@@ -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;