diff options
author | Michael Schmidt <github@mschmidt.me> | 2016-04-06 15:04:40 +0200 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2016-04-06 15:04:40 +0200 |
commit | ebaac5077c279ae07d973e38e13fdb519a3f007c (patch) | |
tree | 5153759c71cd2c6e64ff23b103a969fe672d52cd | |
parent | 2ed2dceef799867bf3dcf971fdf059d2b9ee2130 (diff) | |
download | compcert-ebaac5077c279ae07d973e38e13fdb519a3f007c.tar.gz compcert-ebaac5077c279ae07d973e38e13fdb519a3f007c.zip |
Check for type compatibility when initializing TInt arrays with wide strings (ยง6.7.8), bug 18000
-rw-r--r-- | cparser/Elab.ml | 2 |
1 files changed, 1 insertions, 1 deletions
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); |