aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cparser/Elab.ml8
-rw-r--r--cparser/Elab.mli2
2 files changed, 5 insertions, 5 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index 9e17cb7e..73a80c6f 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -420,11 +420,12 @@ let elab_char_constant loc wide chars =
warning loc Unnamed "character constant too long for its type";
(* C99 6.4.4.4 item 10: single character -> represent at type char
or wchar_t *)
- Ceval.normalize_int v
+ let k =
(if List.length chars = 1 then
if wide then wchar_ikind() else IChar
else
- IInt)
+ IInt) in
+ (Ceval.normalize_int v k, k)
let elab_string_literal loc wide chars =
let nbits = if wide then 8 * !config.sizeof_wchar else 8 in
@@ -452,8 +453,7 @@ let elab_constant loc = function
let (v, fk) = elab_float_constant f in
CFloat(v, fk)
| CONST_CHAR(wide, s) ->
- let ikind = if wide then wchar_ikind () else IInt in
- CInt(elab_char_constant loc wide s, ikind, "")
+ CInt(fst (elab_char_constant loc wide s), IInt, "")
| CONST_STRING(wide, s) ->
elab_string_literal loc wide s
diff --git a/cparser/Elab.mli b/cparser/Elab.mli
index 937e86bf..31d9b281 100644
--- a/cparser/Elab.mli
+++ b/cparser/Elab.mli
@@ -15,7 +15,7 @@
val elab_int_constant : Cabs.cabsloc -> string -> int64 * C.ikind
val elab_float_constant : Cabs.floatInfo -> C.float_cst * C.fkind
-val elab_char_constant : Cabs.cabsloc -> bool -> int64 list -> int64
+val elab_char_constant : Cabs.cabsloc -> bool -> int64 list -> int64 * C.ikind
val elab_file : Cabs.definition list -> C.program
(* This is the main entry point. It transforms a list of toplevel