From d891d7040235542f32b4ce10bb391ef430a05c7d Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 5 Apr 2016 14:02:55 +0200 Subject: Catch initialization of arrays with single expressions, bug 18000 --- cparser/Elab.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cparser') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 248b26f9..87e7ecf6 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1153,8 +1153,8 @@ and elab_item zi item il = (* Single expression to initialize an array *) | SINGLE_INIT a, TArray(ty_elt, sz, _) -> let m = match unroll env ty_elt with - | TInt(t, _) when sizeof_ikind t = 1 -> " or string literal" - | TInt(t, _) when sizeof_ikind t = !config.sizeof_wchar -> " or wide string literal" + | TInt((IChar | ISChar | IUChar), _) -> " or string literal" + | TInt(ik, _) when sizeof_ikind ik = !config.sizeof_wchar -> " or wide string literal" | _ -> "" in error loc "array initializer must be an initializer list%s" m; elab_list zi il false -- cgit