diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2016-11-02 15:57:19 +0100 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2016-11-02 16:05:07 +0100 |
commit | 2c5eef988f11979175de6d1983bc533ce18b1095 (patch) | |
tree | 52fd4bf2c873bbfc746485c474ca897b4a2bff78 /lib/cWarnings.mli | |
parent | 7ba82ed9f595c7d93bd40846993c2447572a817a (diff) |
Fix various shortcomings of the warnings infrastructure.
- The flags are now interpreted from left to right, without any other
precedence rule. The previous one did not make much sense in interactive
mode.
- Set Warnings and Set Warnings Append are now synonyms, and have the
"append" semantics, which is the most natural one for warnings.
- Warnings on unknown warnings are now printed only once (previously the
would be repeated on further calls to Set Warnings, sections closing,
module requiring...).
- Warning status strings are normalized, so that e.g. "+foo,-foo" is reduced
to "-foo" (if foo exists, "" otherwise).
Diffstat (limited to 'lib/cWarnings.mli')
-rw-r--r-- | lib/cWarnings.mli | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/lib/cWarnings.mli b/lib/cWarnings.mli index 351554284..3f6cee31b 100644 --- a/lib/cWarnings.mli +++ b/lib/cWarnings.mli @@ -6,29 +6,16 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -type status = - Disabled | Enabled | AsError - -(* -type 'a repr = { - print : 'a -> Pp.std_ppcmds; - kind : string; - enabled : bool; -} - *) +type status = Disabled | Enabled | AsError val set_current_loc : Loc.t -> unit val create : name:string -> category:string -> ?default:status -> ('a -> Pp.std_ppcmds) -> ?loc:Loc.t -> 'a -> unit -(* -val emit : 'a t -> 'a -> unit - -type any = Any : string * string * 'a repr -> any - -val dump : unit -> any list - *) - val get_flags : unit -> string val set_flags : string -> unit + +(** Cleans up a user provided warnings status string, e.g. removing unknown + warnings (in which case a warning is emitted) or subsumed warnings . *) +val normalize_flags_string : string -> string |