1Warnings(3) OCaml library Warnings(3)
2
3
4
6 Warnings - Warning definitions
7
9 Module Warnings
10
12 Module Warnings
13 : sig end
14
15
16 Warning definitions
17
18 Warning: this module is unstable and part of Compiler_libs .
19
20
21
22
23
24 type loc = {
25 loc_start : Lexing.position ;
26 loc_end : Lexing.position ;
27 loc_ghost : bool ;
28 }
29
30
31
32
33 type t =
34 | Comment_start
35 | Comment_not_end
36 | Fragile_match of string
37 | Ignored_partial_application
38 | Labels_omitted of string list
39 | Method_override of string list
40 | Partial_match of string
41 | Missing_record_field_pattern of string
42 | Non_unit_statement
43 | Redundant_case
44 | Redundant_subpat
45 | Instance_variable_override of string list
46 | Illegal_backslash
47 | Implicit_public_methods of string list
48 | Unerasable_optional_argument
49 | Undeclared_virtual_method of string
50 | Not_principal of string
51 | Non_principal_labels of string
52 | Ignored_extra_argument
53 | Nonreturning_statement
54 | Preprocessor of string
55 | Useless_record_with
56 | Bad_module_name of string
57 | All_clauses_guarded
58 | Unused_var of string
59 | Unused_var_strict of string
60 | Wildcard_arg_to_constant_constr
61 | Eol_in_string
62 | Duplicate_definitions of string * string * string * string
63 | Module_linked_twice of string * string * string
64 | Unused_value_declaration of string
65 | Unused_open of string
66 | Unused_type_declaration of string
67 | Unused_for_index of string
68 | Unused_ancestor of string
69 | Unused_constructor of string * bool * bool
70 | Unused_extension of string * bool * bool * bool
71 | Unused_rec_flag
72 | Name_out_of_scope of string * string list * bool
73 | Ambiguous_name of string list * string list * bool * string
74 | Disambiguated_name of string
75 | Nonoptional_label of string
76 | Open_shadow_identifier of string * string
77 | Open_shadow_label_constructor of string * string
78 | Bad_env_variable of string * string
79 | Attribute_payload of string * string
80 | Eliminated_optional_arguments of string list
81 | No_cmi_file of string * string option
82 | Unexpected_docstring of bool
83 | Wrong_tailcall_expectation of bool
84 | Fragile_literal_pattern
85 | Misplaced_attribute of string
86 | Duplicated_attribute of string
87 | Inlining_impossible of string
88 | Unreachable_case
89 | Ambiguous_var_in_pattern_guard of string list
90 | No_cmx_file of string
91 | Flambda_assignment_to_non_mutable_value
92 | Unused_module of string
93 | Unboxable_type_in_prim_decl of string
94 | Constraint_on_gadt
95 | Erroneous_printed_signature of string
96 | Unsafe_array_syntax_without_parsing
97 | Redefining_unit of string
98 | Unused_open_bang of string
99 | Unused_functor_parameter of string
100 | Match_on_mutable_state_prevent_uncurry
101
102
103
104
105 type alert = {
106 kind : string ;
107 message : string ;
108 def : loc ;
109 use : loc ;
110 }
111
112
113
114
115
116 val parse_options : bool -> string -> unit
117
118
119
120
121 val parse_alert_option : string -> unit
122
123 Disable/enable alerts based on the parameter to the -alert command-line
124 option. Raises Arg.Bad if the string is not a valid specification.
125
126
127
128 val without_warnings : (unit -> 'a) -> 'a
129
130 Run the thunk with all warnings and alerts disabled.
131
132
133
134 val is_active : t -> bool
135
136
137
138
139 val is_error : t -> bool
140
141
142
143
144 val defaults_w : string
145
146
147
148
149 val defaults_warn_error : string
150
151
152
153 type reporting_information = {
154 id : string ;
155 message : string ;
156 is_error : bool ;
157 sub_locs : (loc * string) list ;
158 }
159
160
161
162
163
164 val report : t -> [ `Active of reporting_information | `Inactive ]
165
166
167
168
169 val report_alert : alert -> [ `Active of reporting_information | `Inac‐
170 tive ]
171
172
173
174
175 exception Errors
176
177
178
179
180
181 val check_fatal : unit -> unit
182
183
184
185
186 val reset_fatal : unit -> unit
187
188
189
190
191 val help_warnings : unit -> unit
192
193
194
195 type state
196
197
198
199
200
201 val backup : unit -> state
202
203
204
205
206 val restore : state -> unit
207
208
209
210
211 val mk_lazy : (unit -> 'a) -> 'a Lazy.t
212
213 Like Lazy.of_fun , but the function is applied with the warning/alert
214 settings at the time mk_lazy is called.
215
216
217
218
219
220OCamldoc 2021-07-22 Warnings(3)