Module CWarnings
type status=|Disabled|Enabled|AsErrortype categoryCategories and warnings form a DAG with a common root
alland warnings as the leaves.
val all : category
type warningEach warning belongs to some categories maybe including
"default". It is possible to query the status of awarning(unlike categories). XXX we should probably have"default-error"too.
val create_category : ?from:category list -> name:string -> unit -> categoryWhen
fromis not specified it defaults to[all]. Empty listfromis not allowed. "default" is not allowed infrom.
val create_warning : ?from:category list -> ?default:status -> name:string -> unit -> warningfromworks the same as withcreate_category. In particular default status is specified through thedefaultargument not by using the "default" category.
val create_hybrid : ?from:category list -> ?default:status -> name:string -> unit -> category * warningAs
create_warning, but the warning can also be used as a category i.e. have sub-warnings.
val create_in : warning -> ('a -> Pp.t) -> ?loc:Loc.t -> 'a -> unitCreate a msg with registered printer.
val register_printer : 'a msg -> ('a -> Pp.t) -> unitRegister the printer for a given message. If a printer is already registered it is replaced.
val create : name:string -> ?category:category -> ?default:status -> ('a -> Pp.t) -> ?loc:Loc.t -> 'a -> unitCombined creation function.
namemust be a fresh name.
val get_status : name:string -> statusval normalize_flags_string : string -> stringCleans up a user provided warnings status string, e.g. removing unknown warnings (in which case a warning is emitted) or subsumed warnings .
val with_warn : string -> ('b -> 'a) -> 'b -> 'awith_warn "-xxx,+yyy..." f xcallsf xafter setting the warnings as specified in the string (keeping other previously set warnings), and restores current warnings afterf()returns or raises an exception. If both f and restoring the warnings raise exceptions, the latter is raised.
val check_unknown_warnings : string -> unitWarn with "unknown-warning" if any unknown warnings are in the string with non-disabled status.
val override_unknown_warning : bool Stdlib.refFor command line -w, this avoids using the warning system to avoid breaking "-w -unknown-warning".
module CoreCategories : sig ... end