diff options
author | Michael Schmidt <github@mschmidt.me> | 2016-04-06 10:56:30 +0200 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2016-04-06 10:56:30 +0200 |
commit | 2ed2dceef799867bf3dcf971fdf059d2b9ee2130 (patch) | |
tree | 9b8243d07b038ac06ceb922ec5802030b2b9587b /cparser/Elab.ml | |
parent | ce248e4da35758540e5daa678d80623daeab6453 (diff) | |
download | compcert-2ed2dceef799867bf3dcf971fdf059d2b9ee2130.tar.gz compcert-2ed2dceef799867bf3dcf971fdf059d2b9ee2130.zip |
Check for type compatibility when initializing TInt arrays with wide strings (ยง6.7.8), bug 18000
Diffstat (limited to 'cparser/Elab.ml')
-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 426ffb24..c2c7ff23 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, _) when sizeof_ikind ik = !config.sizeof_wchar -> + | CWStr s, TInt(_, _) when compatible_types AttrCompat 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); |