From 778d0cc5f87472f2da267be8356e5aef7fb75f96 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 20 Aug 2018 11:16:42 +0200 Subject: Improve support and diagnostic for type qualified arrays (#118) * Add diagnostic for type qualified arrays that occur in the wrong place Arrays with type qualifiers (e.g. int t[const 5]) are only allowed as function parameters and for them only the outermost array type derivation. Bug 23400 * Keep attributes from array for argument conversion Type qualifiers of arrays in function parameters are just syntactic sugar to allow adding them to the resulting pointer type. Hence, when a qualified array type such as `int t[const 5]` decays into a pointer type during argument conversion, the pointer type should be qualified, e.g. `int * const t`. --- cparser/Cutil.mli | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cparser/Cutil.mli') diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index 9b09a413..43cbe9bd 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -175,6 +175,8 @@ val integer_rank : ikind -> int (* Order integer kinds from smaller to bigger *) val float_rank : fkind -> int (* Order float kinds from smaller to bigger *) +val is_qualified_array : typ -> bool + (* Does the type contain a qualified array type (e.g. int[const 5])? *) (* Usual conversions over types *) -- cgit