diff options
author | Bernhard Schommer <bschommer@users.noreply.github.com> | 2020-02-24 20:22:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 20:22:45 +0100 |
commit | c7adc93617712acdde0ea81649eff11ada7d96b9 (patch) | |
tree | 0f1171cf656dbde0b928d5bc1c1698c8acd0cae6 /cparser | |
parent | 08efc2a09b850476e39469791650faf99dd06183 (diff) | |
download | compcert-kvx-c7adc93617712acdde0ea81649eff11ada7d96b9.tar.gz compcert-kvx-c7adc93617712acdde0ea81649eff11ada7d96b9.zip |
The type of a wide char constant is wchar_t. (#223)
See ISO C2011 standard, section 6.4.4.4 para 11.
Diffstat (limited to 'cparser')
-rw-r--r-- | cparser/Elab.ml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 9aa6761c..f60e15a3 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -452,7 +452,8 @@ let elab_constant loc = function let (v, fk) = elab_float_constant f in CFloat(v, fk) | CONST_CHAR(wide, s) -> - CInt(elab_char_constant loc wide s, IInt, "") + let ikind = if wide then wchar_ikind () else IInt in + CInt(elab_char_constant loc wide s, ikind, "") | CONST_STRING(wide, s) -> elab_string_literal loc wide s |