diff options
author | Michael Schmidt <github@mschmidt.me> | 2016-04-05 14:02:55 +0200 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2016-04-05 14:02:55 +0200 |
commit | d891d7040235542f32b4ce10bb391ef430a05c7d (patch) | |
tree | 155dd533ae8590a6016f9ae4741365aad0f862d8 /cparser/Elab.ml | |
parent | 5c88ca36f5225231cc595fe0352c50a9e9fe83a2 (diff) | |
download | compcert-d891d7040235542f32b4ce10bb391ef430a05c7d.tar.gz compcert-d891d7040235542f32b4ce10bb391ef430a05c7d.zip |
Catch initialization of arrays with single expressions, bug 18000
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 4 |
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 |