Commit f6a8fcac authored by MARCHE Claude's avatar MARCHE Claude

Add a debug flag to ignore the warnings on unused variables

parent 8a11378a
......@@ -429,7 +429,12 @@ let quant_vars ~strict env vl =
let acc, vl = Lists.map_fold_left add Mstr.empty vl in
Mstr.set_union acc env, vl
let debug_ignore_unused_var = Debug.register_info_flag "ignore_unused_vars"
~desc:"Suppress@ warnings@ on@ unused@ variables"
let check_used_var t vs =
if not (Debug.test_flag debug_ignore_unused_var) then
let s = vs.vs_name.id_string in
if (s = "" || s.[0] <> '_') && t_v_occurs vs t = 0 then
Warning.emit ?loc:vs.vs_name.id_loc "unused variable %s" s
......
......@@ -103,6 +103,8 @@ val dterm : ?loc:Loc.position -> dterm_node -> dterm
(** Final stage *)
val debug_ignore_unused_var : Debug.flag
val term : ?strict:bool -> ?keep_loc:bool -> dterm -> term
val fmla : ?strict:bool -> ?keep_loc:bool -> dterm -> term
......@@ -1095,6 +1095,7 @@ let spec_invariant env pvs vty spec =
(** Abstract values *)
let warn_unused s loc =
if not (Debug.test_flag Dterm.debug_ignore_unused_var) then
if s = "" || s.[0] <> '_' then
Warning.emit ?loc "unused variable %s" s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment