Skip to content

Commit e559ead

Browse files
authored
Merge pull request #90 from goblint/fix-warnings
Fix OCaml 4.14 deprecation warnings
2 parents da5e194 + 5455f2a commit e559ead

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/check.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ and checkInit (i: init) : typ =
658658
| (Index(Const(CInt(i', _, _)), NoOffset), ei) :: rest ->
659659
if Int64.compare (Z.to_int64 i') i <> 0 then
660660
ignore (warn "Initializer for index %s when %s was expected"
661-
(Int64.format "%d" (Z.to_int64 i')) (Int64.format "%d" i));
661+
(Printf.sprintf "%Ld" (Z.to_int64 i')) (Printf.sprintf "%Ld" i));
662662
checkInitType ei bt;
663663
loopIndex (Int64.succ i) rest
664664
| _ :: rest ->

src/frontc/cabs2cil.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4277,7 +4277,7 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
42774277
if isBuiltinNan && asconst then
42784278
(* Replace call to builtin nan with computation yielding NaN *)
42794279
let onef = Const(CReal(0.0,FDouble,None)) in
4280-
let zerodivzero = mkCast (BinOp(Div,onef,onef,doubleType)) resType in
4280+
let zerodivzero = mkCast ~e:(BinOp(Div,onef,onef,doubleType)) ~newt:resType in
42814281
(empty,zerodivzero,resType)
42824282
else (
42834283
(* If the "--forceRLArgEval" flag was used, make sure

src/ocamlutil/pretty.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -725,31 +725,31 @@ let gprintf (finish : doc -> 'b)
725725
invalid_arg ("dprintf: unimplemented format "
726726
^ (String.sub format i (j-i+1)));
727727
let j' = succ j in (* eat the d,i,x etc. *)
728-
let format_spec = Bytes.of_string "% " in
729-
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
728+
let format_spec = Bytes.of_string "%L " in
729+
Bytes.set format_spec 2 (fget j'); (* format_spec = "%Lx", etc. *)
730730
Obj.magic(fun n ->
731731
collect (dctext1 acc
732-
(Int64.format (Bytes.to_string format_spec) n))
732+
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%Lx") n))
733733
(succ j'))
734734
| 'l' ->
735735
if j != i + 1 then invalid_arg ("dprintf: unimplemented format "
736736
^ (String.sub format i (j-i+1)));
737737
let j' = succ j in (* eat the d,i,x etc. *)
738-
let format_spec = Bytes.of_string "% " in
739-
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
738+
let format_spec = Bytes.of_string "%l " in
739+
Bytes.set format_spec 2 (fget j'); (* format_spec = "%lx", etc. *)
740740
Obj.magic(fun n ->
741741
collect (dctext1 acc
742-
(Int32.format (Bytes.to_string format_spec) n))
742+
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%lx") n))
743743
(succ j'))
744744
| 'n' ->
745745
if j != i + 1 then invalid_arg ("dprintf: unimplemented format "
746746
^ (String.sub format i (j-i+1)));
747747
let j' = succ j in (* eat the d,i,x etc. *)
748-
let format_spec = Bytes.of_string "% " in
749-
Bytes.set format_spec 1 (fget j'); (* format_spec = "%x", etc. *)
748+
let format_spec = Bytes.of_string "%n " in
749+
Bytes.set format_spec 2 (fget j'); (* format_spec = "%nx", etc. *)
750750
Obj.magic(fun n ->
751751
collect (dctext1 acc
752-
(Nativeint.format (Bytes.to_string format_spec) n))
752+
(Printf.sprintf (Scanf.format_from_string (Bytes.to_string format_spec) "%nx") n))
753753
(succ j'))
754754
| 'f' | 'e' | 'E' | 'g' | 'G' ->
755755
Obj.magic(fun f ->

0 commit comments

Comments
 (0)