diff options
author | Michael Schmidt <github@mschmidt.me> | 2016-04-05 14:33:49 +0200 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2016-04-05 14:33:49 +0200 |
commit | 567ed78280922ae5285583358b3303fde69401d0 (patch) | |
tree | 83451ab0ba69f4a681f83ea5976ee914998b80ce | |
parent | d891d7040235542f32b4ce10bb391ef430a05c7d (diff) | |
download | compcert-567ed78280922ae5285583358b3303fde69401d0.tar.gz compcert-567ed78280922ae5285583358b3303fde69401d0.zip |
Match type size with size of wchar_t when initializing TInt arrays with wide strings, 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 87e7ecf6..08e6844a 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, _) -> + | CWStr s, TInt(ik, _) when sizeof_ikind ik = !config.sizeof_wchar -> 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); |