Skip to content

Commit 01a3c9e

Browse files
committed
add a signal to indicate if it has_warnings or not
1 parent a88f196 commit 01a3c9e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

utils/warnings.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ let sub_locs = function
620620
]
621621
| _ -> []
622622

623+
let has_warnings = ref false ;;
623624
let nerrors = ref 0;;
624625

625626
type reporting_information =
@@ -639,6 +640,7 @@ let report w =
639640
match is_active w with
640641
| false -> `Inactive
641642
| true ->
643+
has_warnings := true;
642644
if is_error w then incr nerrors;
643645
`Active { number = number w; message = message w; is_error = is_error w;
644646
sub_locs = sub_locs w;

utils/warnings.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t
134134
the warning settings at the time [mk_lazy] is called. *)
135135

136136
#if true then
137+
val has_warnings : bool ref
137138
val nerrors : int ref
138139
val message : t -> string
139140
val number: t -> int

0 commit comments

Comments
 (0)