Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ and checkInit (i: init) : typ =
| (Index(Const(CInt(i', _, _)), NoOffset), ei) :: rest ->
if Int64.compare (Z.to_int64 i') i <> 0 then
ignore (warn "Initializer for index %s when %s was expected"
(Int64.format "%d" (Z.to_int64 i')) (Int64.format "%d" i));
(Printf.sprintf "%Ld" (Z.to_int64 i')) (Printf.sprintf "%Ld" i));
checkInitType ei bt;
loopIndex (Int64.succ i) rest
| _ :: rest ->
Expand Down
2 changes: 1 addition & 1 deletion src/frontc/cabs2cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4277,7 +4277,7 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
if isBuiltinNan && asconst then
(* Replace call to builtin nan with computation yielding NaN *)
let onef = Const(CReal(0.0,FDouble,None)) in
let zerodivzero = mkCast (BinOp(Div,onef,onef,doubleType)) resType in
let zerodivzero = mkCast ~e:(BinOp(Div,onef,onef,doubleType)) ~newt:resType in
(empty,zerodivzero,resType)
else (
(* If the "--forceRLArgEval" flag was used, make sure
Expand Down
18 changes: 9 additions & 9 deletions src/ocamlutil/pretty.ml
Original file line number Diff line number Diff line change
Expand Up @@ -725,31 +725,31 @@ let gprintf (finish : doc -> 'b)
invalid_arg ("dprintf: unimplemented format "
^ (String.sub format i (j-i+1)));
let j' = succ j in (* eat the d,i,x etc. *)
let format_spec = Bytes.of_string "% " in
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
let format_spec = Bytes.of_string "%L " in
Bytes.set format_spec 2 (fget j'); (* format_spec = "%Lx", etc. *)
Obj.magic(fun n ->
collect (dctext1 acc
(Int64.format (Bytes.to_string format_spec) n))
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%Lx") n))
(succ j'))
| 'l' ->
if j != i + 1 then invalid_arg ("dprintf: unimplemented format "
^ (String.sub format i (j-i+1)));
let j' = succ j in (* eat the d,i,x etc. *)
let format_spec = Bytes.of_string "% " in
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
let format_spec = Bytes.of_string "%l " in
Bytes.set format_spec 2 (fget j'); (* format_spec = "%lx", etc. *)
Obj.magic(fun n ->
collect (dctext1 acc
(Int32.format (Bytes.to_string format_spec) n))
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%lx") n))
(succ j'))
| 'n' ->
if j != i + 1 then invalid_arg ("dprintf: unimplemented format "
^ (String.sub format i (j-i+1)));
let j' = succ j in (* eat the d,i,x etc. *)
let format_spec = Bytes.of_string "% " in
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
let format_spec = Bytes.of_string "%n " in
Bytes.set format_spec 2 (fget j'); (* format_spec = "%nx", etc. *)
Obj.magic(fun n ->
collect (dctext1 acc
(Nativeint.format (Bytes.to_string format_spec) n))
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%nx") n))
(succ j'))
| 'f' | 'e' | 'E' | 'g' | 'G' ->
Obj.magic(fun f ->
Expand Down