File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ let continueOnError = true
6363(* * Turn on tranformation that forces correct parameter evaluation order *)
6464let forceRLArgEval = ref false
6565
66+ (* * By default, we warn as large constants cannot be appropriately represented as OCaml floats.
67+ This can be set to true by tools that are aware of this problem and only use the string component of CReal
68+ to avoid emitting warnings that are spurious in that context. *)
69+ let silenceLongDoubleWarning = ref false
70+
6671(* * Leave a certain global alone. Use a negative number to disable. *)
6772let nocil: int ref = ref (- 1 )
6873
@@ -3706,7 +3711,7 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
37063711 else
37073712 str, FDouble
37083713 in
3709- if kind = FLongDouble || kind = FFloat128 then
3714+ if ( kind = FLongDouble || kind = FFloat128 ) && not ! silenceLongDoubleWarning then
37103715 (* We only have 64-bit values in Ocaml *)
37113716 E. log " treating %a constant %s as double constant at %a (only relevant if first argument of CReal is used).\n "
37123717 d_fkind kind str d_loc ! currentLoc;
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ val convFile: Cabs.file -> Cil.file
4141(* * Turn on tranformation that forces correct parameter evaluation order *)
4242val forceRLArgEval : bool ref
4343
44+ (* * By default, we warn as large constants cannot be appropriately represented as OCaml floats.
45+ This can be set to true by tools that are aware of this problem and only use the string component of CReal
46+ to avoid emitting warnings that are spurious in that context. *)
47+ val silenceLongDoubleWarning : bool ref
48+
4449(* * Set this integer to the index of the global to be left in CABS form. Use
4550 -1 to disable *)
4651val nocil : int ref
You can’t perform that action at this time.
0 commit comments