From ebaac5077c279ae07d973e38e13fdb519a3f007c Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 6 Apr 2016 15:04:40 +0200 Subject: Check for type compatibility when initializing TInt arrays with wide strings (ยง6.7.8), bug 18000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cparser/Elab.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cparser/Elab.ml b/cparser/Elab.ml index c2c7ff23..91a795e9 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1134,7 +1134,7 @@ and elab_item zi item il = | CStr _, _ -> error loc "initialization of an array of non-char elements with a string literal"; elab_list zi il false - | CWStr s, TInt(_, _) when compatible_types AttrCompat env ty_elt (TInt(wchar_ikind(), [])) -> + | CWStr s, TInt(_, _) when compatible_types AttrIgnoreTop env ty_elt (TInt(wchar_ikind(), [])) -> if not (I.index_below (Int64.of_int(List.length s - 1)) sz) then warning loc "initializer string for array of wide chars %s is too long" (I.name zi); -- cgit