Warnings(3)
π Warnings β Warning definitions π
okay so bestie, this is the Warnings module from the OCaml library, manual page Warnings(3) β no cap. Itβs literally the page for warning definitions, and the whole vibe is βhere are all the warning types and the little functions that go with them.β π«Ά
π NAME π
Warnings β Warning definitions. Thatβs the tea. π
π§© Module π§©
The module is Warnings. Thatβs it, thatβs the module. π
π Documentation π
Hereβs the module signature wrapper, bestie:
Module Warnings
: sig end
πΈ Warning definitions πΈ
π¨ Warning: this module is unstable and part of Compiler_libs .
Lowkey important, highkey still iconic. Now onto the types. β¨
type loc β the location record, with all three fields:
type loc = {
loc_start : Lexing.position ;
loc_end : Lexing.position ;
loc_ghost : bool ;
}
val ghost_loc_in_file : string -> locβ returns an empty ghost range located in a given file. π»
type field_usage_warning β the field-usage warning variants:
type field_usage_warning =
| Unused
| Not_read
| Not_mutated
type constructor_usage_warning β the constructor-usage warning variants:
type constructor_usage_warning =
| Unused
| Not_constructed
| Only_exported_private
type type_declaration_usage_warning β the type-declaration usage warning variants:
type type_declaration_usage_warning =
| Declaration
| Alias
type t β okay bestie, this is the big one. The way this type ate and left no crumbs. All the warning constructors, periodt:
type t =
| Comment_start
| Comment_not_end
| Fragile_match of string
| Ignored_partial_application
| Labels_omitted of string list
| Method_override of string list
| Partial_match of Format_doc.t
| Missing_record_field_pattern of string
| Non_unit_statement
| Redundant_case
| Redundant_subpat
| Instance_variable_override of string list
| Illegal_backslash
| Implicit_public_methods of string list
| Unerasable_optional_argument
| Undeclared_virtual_method of string
| Not_principal of Format_doc.t
| Non_principal_labels of string
| Ignored_extra_argument
| Nonreturning_statement
| Preprocessor of string
| Useless_record_with
| Bad_module_name of string
| All_clauses_guarded
| Unused_var of string
| Unused_var_strict of string
| Wildcard_arg_to_constant_constr
| Eol_in_string
| Duplicate_definitions of string * string * string * string
| Unused_value_declaration of string
| Unused_open of string
| Unused_type_declaration of string * type_declaration_usage_warning
| Unused_for_index of string
| Unused_ancestor of string
| Unused_constructor of string * constructor_usage_warning
| Unused_extension of string * bool * constructor_usage_warning
| Unused_rec_flag
| Name_out_of_scope of string * string list * bool
| Ambiguous_name of string list * string list * bool * string
| Disambiguated_name of string
| Nonoptional_label of string
| Open_shadow_identifier of string * string
| Open_shadow_label_constructor of string * string
| Bad_env_variable of string * string
| Attribute_payload of string * string
| Eliminated_optional_arguments of string list
| No_cmi_file of string * string option
| Unexpected_docstring of bool
| Wrong_tailcall_expectation of bool
| Fragile_literal_pattern
| Misplaced_attribute of string
| Duplicated_attribute of string
| Inlining_impossible of string
| Unreachable_case
| Ambiguous_var_in_pattern_guard of string list
| No_cmx_file of string
| Flambda_assignment_to_non_mutable_value
| Unused_module of string
| Unboxable_type_in_prim_decl of string
| Constraint_on_gadt
| Erroneous_printed_signature of string
| Unsafe_array_syntax_without_parsing
| Redefining_unit of string
| Unused_open_bang of string
| Unused_functor_parameter of string
| Match_on_mutable_state_prevent_uncurry
| Unused_field of string * field_usage_warning
| Missing_mli
| Unused_tmc_attribute
| Tmc_breaks_tailcall
| Generative_application_expects_unit
| Degraded_to_partial_match
| Unnecessarily_partial_tuple_pattern
type alert β the alert record, with its four fields:
type alert = {
kind : string ;
message : string ;
def : loc ;
use : loc ;
}
val parse_options : bool -> string -> alert optionβ signature only, no extra notes here. πval parse_alert_option : string -> unitβ disables/enables alerts based on the parameter to the-alertcommand-line option. RaisesArg.Badif the string is not a valid specification. π¨val without_warnings : (unit -> 'a) -> 'aβ runs the thunk with all warnings and alerts disabled. πval is_active : t -> boolβ signature only. β¨val is_error : t -> boolβ signature only. β¨val defaults_w : stringβ signature only. πval defaults_warn_error : stringβ signature only. π
type reporting_information β the reporting-info record:
type reporting_information = {
id : string ;
message : Format_doc.t ;
is_error : bool ;
sub_locs : (loc * Format_doc.t) list ;
}
val report : t -> [Active of reporting_information |Inactive ]β signature only. πval report_alert : alert -> [Active of reporting_information |Inactive ]β signature only. π
exception Errors β yes, an exception literally named Errors. π
val check_fatal : unit -> unitβ signature only. π₯val reset_fatal : unit -> unitβ signature only. π₯val help_warnings : unit -> unitβ signature only. π«Ά
type state β signature only, no fields listed.
val backup : unit -> stateβ signature only. πval restore : state -> unitβ signature only. πval with_state : state -> (unit -> 'a) -> 'aβ signature only. πval mk_lazy : (unit -> 'a) -> 'a Lazy.tβ likeLazy.of_fun, but the function is applied with the warning/alert settings at the timemk_lazyis called. π¦
type description β the description record:
type description = {
number : int ;
names : string list ;
description : string ;
since : Sys.ocaml_release_info option ;
}
val descriptions : description listβ signature only. π
β¨ footer vibe check: source/version OCamldoc, date 2026-06-22, manual page Warnings(3) β bye bestie, mwah ππ
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms