aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorMichael Schmidt <github@mschmidt.me>2016-04-05 14:02:55 +0200
committerMichael Schmidt <github@mschmidt.me>2016-04-05 14:02:55 +0200
commitd891d7040235542f32b4ce10bb391ef430a05c7d (patch)
tree155dd533ae8590a6016f9ae4741365aad0f862d8 /cparser
parent5c88ca36f5225231cc595fe0352c50a9e9fe83a2 (diff)
downloadcompcert-d891d7040235542f32b4ce10bb391ef430a05c7d.tar.gz
compcert-d891d7040235542f32b4ce10bb391ef430a05c7d.zip
Catch initialization of arrays with single expressions, bug 18000
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Elab.ml4
1 files changed, 2 insertions, 2 deletions
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