Skip to content

Commit

Permalink
enable warning 6 [labels-omitted] by default
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Jan 11, 2021
1 parent 134b6a2 commit e6bfd51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Changes
Expand Up @@ -70,6 +70,14 @@ Working version
the source code than the point explicitly shown in the error message.
(François Pottier, review by Gabriel Scherer and Frédéric Bour.)

- #10118, #10140: enable warning 6 [labels-omitted] by default.
The following now warns:
let f ~x y = ... in f 3 5
the callsite (f 3 5) has to be turned into (f ~x:3 5).
This prevents mistakes where two arguments of the same types are swapped.
(Note: Dune already enables this warning by default.)
(Gabriel Scherer, review by Xavier Leroy, report by ygrek)

### Internal/compiler-libs changes:

- #9650, #9651: keep refactoring the pattern-matching compiler
Expand Down
2 changes: 1 addition & 1 deletion man/ocamlc.m
Expand Up @@ -1017,7 +1017,7 @@ compilation in any way (even if it is fatal). If a warning is enabled,

.IP
The default setting is
.BR \-w\ +a\-4\-6\-7\-9\-27\-29\-30\-32..42\-44\-45\-48\-50\-60\-66\-67\-68 .
.BR \-w\ +a\-4\-7\-9\-27\-29\-30\-32..42\-44\-45\-48\-50\-60\-66\-67\-68 .
Note that warnings
.BR 5 \ and \ 10
are not always triggered, depending on the internals of the type checker.
Expand Down
2 changes: 1 addition & 1 deletion utils/warnings.ml
Expand Up @@ -572,7 +572,7 @@ let parse_options errflag s =
current := {(!current) with error; active}

(* If you change these, don't forget to change them in man/ocamlc.m *)
let defaults_w = "+a-4-6-7-9-27-29-30-32..42-44-45-48-50-60-66-67-68";;
let defaults_w = "+a-4-7-9-27-29-30-32..42-44-45-48-50-60-66-67-68";;
let defaults_warn_error = "-a+31";;

let () = parse_options false defaults_w;;
Expand Down

0 comments on commit e6bfd51

Please sign in to comment.