From e9b5632617b1477603883aab543994e2a1c464ce Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 20 Aug 2018 10:42:22 +0200 Subject: Additional checks for flex arrays in structs (#93) * Error for structs with only flex array member Flexible array members are only allowed if another member exists. Bug 23324 * Added checks for nesting of structs with flex array members Warn if a struct with a flex array member is used as array element or member of another struct. Such usage is dubious. Bug 23324 Don't warn if the struct-with-flex-array is a member of an union. --- cparser/Diagnostics.mli | 1 + 1 file changed, 1 insertion(+) (limited to 'cparser/Diagnostics.mli') diff --git a/cparser/Diagnostics.mli b/cparser/Diagnostics.mli index 0d49cd0b..62c54314 100644 --- a/cparser/Diagnostics.mli +++ b/cparser/Diagnostics.mli @@ -52,6 +52,7 @@ type warning_type = | Ignored_attributes (** attributes declarations after definition *) | Extern_after_definition (** extern declaration after non-extern definition *) | Static_in_inline (** static variable in non-static inline function *) + | Flexible_array_extensions (** usange of structs with flexible arrays in structs and arrays *) val warning : (string * int) -> warning_type -> ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a (** [warning (f,c) w fmt arg1 ... argN] formats the arguments [arg1] to [argN] as warining according to -- cgit