From 567ed78280922ae5285583358b3303fde69401d0 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 5 Apr 2016 14:33:49 +0200 Subject: Match type size with size of wchar_t when initializing TInt arrays with wide strings, bug 18000 --- cparser/Elab.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cparser/Elab.ml') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 87e7ecf6..08e6844a 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(ik, _) -> + | CWStr s, TInt(ik, _) when sizeof_ikind ik = !config.sizeof_wchar -> 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