diff options
Diffstat (limited to 'utils/warnings.ml')
-rw-r--r-- | utils/warnings.ml | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/utils/warnings.ml b/utils/warnings.ml index 46a01e2440..1f99b63c82 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -50,12 +50,13 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) - | Unused_value_declaration of string (* 31 *) - | Unused_open of string (* 32 *) - | Unused_type_declaration of string (* 33 *) - | Unused_for_index of string (* 34 *) - | Unused_ancestor of string (* 35 *) - | Unused_constructor of string (* 36 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) + | Unused_open of string (* 33 *) + | Unused_type_declaration of string (* 34 *) + | Unused_for_index of string (* 35 *) + | Unused_ancestor of string (* 36 *) + | Unused_constructor of string (* 37 *) ;; (* If you remove a warning, leave a hole in the numbering. NEVER change @@ -95,15 +96,16 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 - | Unused_value_declaration _ -> 31 - | Unused_open _ -> 32 - | Unused_type_declaration _ -> 33 - | Unused_for_index _ -> 34 - | Unused_ancestor _ -> 35 - | Unused_constructor _ -> 36 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 + | Unused_open _ -> 33 + | Unused_type_declaration _ -> 34 + | Unused_for_index _ -> 35 + | Unused_ancestor _ -> 36 + | Unused_constructor _ -> 37 ;; -let last_warning_number = 36;; +let last_warning_number = 37;; (* Must be the max number returned by the [number] function. *) let letter = function @@ -198,7 +200,7 @@ let parse_opt flags s = let parse_options errflag s = parse_opt (if errflag then error else active) s;; (* If you change these, don't forget to change them in man/ocamlc.m *) -let defaults_w = "+a-4-6-7-9-27-29-31-32-33-34-35-36";; +let defaults_w = "+a-4-6-7-9-27-29-32-33-34-35-36-37";; let defaults_warn_error = "-a";; let () = parse_options false defaults_w;; @@ -272,6 +274,10 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> + Printf.sprintf + "files %s and %s both define a module named %s" + file1 file2 modname | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -352,12 +358,13 @@ let descriptions = 29, "Unescaped end-of-line in a string constant (non-portable code)."; 30, "Two labels or constructors of the same name are defined in two\n\ \ mutually recursive types."; - 31, "Unused value declaration."; - 32, "Unused open statement."; - 33, "Unused type declaration."; - 34, "Unused for-loop index."; - 35, "Unused ancestor variable."; - 36, "Unused constructor."; + 31, "A module is linked twice in the same executable."; + 32, "Unused value declaration."; + 33, "Unused open statement."; + 34, "Unused type declaration."; + 35, "Unused for-loop index."; + 36, "Unused ancestor variable."; + 37, "Unused constructor."; ] ;; |