aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorMichael Schmidt <github@mschmidt.me>2016-04-05 14:33:49 +0200
committerMichael Schmidt <github@mschmidt.me>2016-04-05 14:33:49 +0200
commit567ed78280922ae5285583358b3303fde69401d0 (patch)
tree83451ab0ba69f4a681f83ea5976ee914998b80ce /cparser
parentd891d7040235542f32b4ce10bb391ef430a05c7d (diff)
downloadcompcert-567ed78280922ae5285583358b3303fde69401d0.tar.gz
compcert-567ed78280922ae5285583358b3303fde69401d0.zip
Match type size with size of wchar_t when initializing TInt arrays with wide strings, bug 18000
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Elab.ml2
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);