The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix PR6638: add dedicated wrning for "unused open!" (#1110)

authored by

Alain Frisch and committed by
GitHub
7baf33d6 1ec0ece0

+286 -76
+6
Changes
··· 266 266 - MPR#7864, GPR#2109: remove duplicates from spelling suggestions. 267 267 (Nicolás Ojeda Bär, review by Armaël Guéneau) 268 268 269 + - MPR#6638, GPR#1110: introduced a dedicated warning to report 270 + unused "open!" statements 271 + (Alain Frisch, report by dwang, review by and design from Leo White) 272 + 273 + 269 274 ### Code generation and optimizations: 270 275 271 276 - MPR#7725, GPR#1754: improve AFL instrumentation for objects and lazy values. ··· 627 632 - GPR#2130: fix printing of type variables with a quote in their name 628 633 (Alain Frisch, review by Armaël Guéneau and Gabriel Scherer, 629 634 report by Hugo Heuzard) 635 + 630 636 631 637 OCaml 4.07.1 (4 October 2018) 632 638 -----------------------------
+1 -1
Makefile
··· 51 51 -I middle_end/base_types -I asmcomp -I asmcomp/debug \ 52 52 -I driver -I toplevel 53 53 54 - COMPFLAGS=-strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48 \ 54 + COMPFLAGS=-strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48-66 \ 55 55 -warn-error A \ 56 56 -bin-annot -safe-string -strict-formats $(INCLUDES) 57 57 LINKFLAGS=
+4 -1
man/ocamlc.m
··· 976 976 65 977 977 \ \ Type declaration defining a new '()' constructor 978 978 979 + 66 980 + \ \ Unused open! statement. 981 + 979 982 The letters stand for the following sets of warnings. Any letter not 980 983 mentioned here corresponds to the empty set. 981 984 ··· 1029 1032 1030 1033 .IP 1031 1034 The default setting is 1032 - .BR \-w\ +a\-4\-6\-7\-9\-27\-29\-32..42\-44\-45\-48\-50\-60 . 1035 + .BR \-w\ +a\-4\-6\-7\-9\-27\-29\-32..42\-44\-45\-48\-50\-60\-66 . 1033 1036 Note that warnings 1034 1037 .BR 5 \ and \ 10 1035 1038 are not always triggered, depending on the internals of the type checker.
+1 -1
middle_end/alias_analysis.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type allocation_point =
+1 -1
middle_end/allocated_const.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type t =
+1 -1
middle_end/augment_specialised_args.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module E = Inline_and_simplify_aux.Env
+1 -1
middle_end/base_types/closure_element.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Variable
+1 -1
middle_end/base_types/closure_id.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Closure_element
+1 -1
middle_end/base_types/closure_origin.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Closure_id
+1 -1
middle_end/base_types/compilation_unit.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type t = {
+1 -1
middle_end/base_types/export_id.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Id : Id_types.Id = Id_types.Id (struct end)
+1 -1
middle_end/base_types/id_types.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module type BaseId = sig
+1 -1
middle_end/base_types/linkage_name.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type t = string
+1 -1
middle_end/base_types/mutable_variable.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Variable
+1 -1
middle_end/base_types/set_of_closures_id.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Id : Id_types.Id = Id_types.Id (struct end)
+1 -1
middle_end/base_types/set_of_closures_origin.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Set_of_closures_id
+1 -1
middle_end/base_types/static_exception.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Numbers.Int
+1 -1
middle_end/base_types/symbol.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20
+1 -1
middle_end/base_types/tag.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type t = int
+1 -1
middle_end/base_types/var_within_closure.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 include Closure_element
+1 -1
middle_end/base_types/variable.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type t = {
+1 -1
middle_end/closure_conversion.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Env = Closure_conversion_aux.Env
+1 -1
middle_end/closure_conversion_aux.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Env = struct
+1 -1
middle_end/effect_analysis.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let no_effects_prim (prim : Lambda.primitive) =
+1 -1
middle_end/extract_projections.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module A = Simple_value_approx
+1 -1
middle_end/find_recursive_functions.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let in_function_declarations (function_decls : Flambda.function_declarations)
+1 -1
middle_end/flambda.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type call_kind =
+1 -1
middle_end/flambda_invariants.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type flambda_kind =
+1 -1
middle_end/flambda_iterators.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let apply_on_subexpressions f f_named (flam : Flambda.t) =
+1 -1
middle_end/flambda_utils.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let name_expr ~name (named : Flambda.named) : Flambda.t =
+1 -1
middle_end/freshening.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type tbl = {
+1 -1
middle_end/inconstant_idents.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (* This cannot be done in a single simple pass due to expressions like:
+1 -1
middle_end/initialize_symbol_to_let_symbol.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let constant_field (expr:Flambda.t)
+1 -1
middle_end/inline_and_simplify.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module A = Simple_value_approx
+1 -1
middle_end/inline_and_simplify_aux.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Env = struct
+1 -1
middle_end/inlining_cost.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (* Simple approximation of the space cost of a primitive. *)
+1 -1
middle_end/inlining_decision.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module A = Simple_value_approx
+1 -1
middle_end/inlining_stats.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Closure_stack = struct
+1 -1
middle_end/inlining_stats_types.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Wsb = Inlining_cost.Whether_sufficient_benefit
+1 -1
middle_end/inlining_transforms.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module B = Inlining_cost.Benefit
+1 -1
middle_end/internal_variable_names.ml
··· 12 12 (* *) 13 13 (**************************************************************************) 14 14 15 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 15 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 16 16 open! Int_replace_polymorphic_compare 17 17 18 18 type t = string
+1 -1
middle_end/invariant_params.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (* CR-someday pchambart to pchambart: in fact partial application doesn't
+1 -1
middle_end/lift_code.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type lifter = Flambda.program -> Flambda.program
+1 -1
middle_end/lift_constants.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (* CR-someday mshinwell: move to Flambda_utils *)
+1 -1
middle_end/lift_let_to_initialize_symbol.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 type ('a, 'b) kind =
+1 -1
middle_end/middle_end.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let _dump_function_sizes flam ~backend =
+1 -1
middle_end/parameter.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 [@@@ocaml.warning "+9"]
+1 -1
middle_end/pass_wrapper.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let register ~pass_name =
+1 -1
middle_end/projection.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (* CR-someday mshinwell: Move these three types into their own modules. *)
+1 -1
middle_end/ref_to_variables.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let variables_not_used_as_local_reference (tree:Flambda.t) =
+1 -1
middle_end/remove_free_vars_equal_to_args.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let pass_name = "remove-free-vars-equal-to-args"
+1 -1
middle_end/remove_unused_arguments.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let pass_name = "remove-unused-arguments"
+1 -1
middle_end/remove_unused_closure_vars.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 (** A variable in a closure can either be used by the closure itself
+1 -1
middle_end/remove_unused_program_constructs.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 let dependency (expr:Flambda.t) = Flambda.free_symbols expr
+1 -1
middle_end/share_constants.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module Constant_defining_value = Flambda.Constant_defining_value
+1 -1
middle_end/simple_value_approx.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module U = Flambda_utils
+1 -1
middle_end/simplify_boxed_integer_ops.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module S = Simplify_common
+1 -1
middle_end/simplify_common.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module A = Simple_value_approx
+1 -1
middle_end/simplify_primitives.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module A = Simple_value_approx
+1 -1
middle_end/unbox_closures.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module ASA = Augment_specialised_args
+1 -1
middle_end/unbox_free_vars_of_closures.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module B = Inlining_cost.Benefit
+1 -1
middle_end/unbox_specialised_args.ml
··· 14 14 (* *) 15 15 (**************************************************************************) 16 16 17 - [@@@ocaml.warning "+a-4-9-30-40-41-42"] 17 + [@@@ocaml.warning "+a-4-9-30-40-41-42-66"] 18 18 open! Int_replace_polymorphic_compare 19 19 20 20 module ASA = Augment_specialised_args
+1
testsuite/tests/typing-warnings/ocamltests
··· 13 13 records.ml 14 14 unused_rec.ml 15 15 unused_types.ml 16 + open_warnings.ml
+179
testsuite/tests/typing-warnings/open_warnings.ml
··· 1 + (* TEST 2 + flags = " -w A-41-42-18" 3 + * expect 4 + *) 5 + module T1 : sig end = struct 6 + module M = struct type t end (* unused type t *) 7 + open M (* unused open *) 8 + end;; 9 + [%%expect{| 10 + Line 2, characters 20-26: 11 + 2 | module M = struct type t end (* unused type t *) 12 + ^^^^^^ 13 + Warning 34: unused type t. 14 + Line 3, characters 2-8: 15 + 3 | open M (* unused open *) 16 + ^^^^^^ 17 + Warning 33: unused open M. 18 + module T1 : sig end 19 + |}] 20 + 21 + 22 + module T2 : sig type s end = struct 23 + module M = struct type t end 24 + open M (* used by line below *) 25 + type s = t 26 + end;; 27 + [%%expect{| 28 + module T2 : sig type s end 29 + |}] 30 + 31 + module T3 : sig end = struct 32 + type t0 = A (* unused type and constructor *) 33 + module M = struct type t = A end 34 + open M (* used by line below; shadow constructor A *) 35 + let _ = A (* A belongs to several types *) 36 + end;; 37 + [%%expect{| 38 + Line 4, characters 2-8: 39 + 4 | open M (* used by line below; shadow constructor A *) 40 + ^^^^^^ 41 + Warning 45: this open statement shadows the constructor A (which is later used) 42 + Line 2, characters 2-13: 43 + 2 | type t0 = A (* unused type and constructor *) 44 + ^^^^^^^^^^^ 45 + Warning 34: unused type t0. 46 + Line 2, characters 2-13: 47 + 2 | type t0 = A (* unused type and constructor *) 48 + ^^^^^^^^^^^ 49 + Warning 37: unused constructor A. 50 + module T3 : sig end 51 + |}] 52 + 53 + module T4 : sig end = struct 54 + type t0 = A 55 + module M = struct type t = A end (* unused type and constructor *) 56 + open M (* unused open; no shadowing (A below refers to the one in t0) *) 57 + let _ : t0 = A (* disambiguation used *) 58 + end;; 59 + [%%expect{| 60 + Line 3, characters 20-30: 61 + 3 | module M = struct type t = A end (* unused type and constructor *) 62 + ^^^^^^^^^^ 63 + Warning 34: unused type t. 64 + Line 3, characters 20-30: 65 + 3 | module M = struct type t = A end (* unused type and constructor *) 66 + ^^^^^^^^^^ 67 + Warning 37: unused constructor A. 68 + Line 4, characters 2-8: 69 + 4 | open M (* unused open; no shadowing (A below refers to the one in t0) *) 70 + ^^^^^^ 71 + Warning 33: unused open M. 72 + module T4 : sig end 73 + |}] 74 + 75 + module T5 : sig end = struct 76 + type t0 = A (* unused type and constructor *) 77 + module M = struct type t = A end 78 + open M (* shadow constructor A *) 79 + let _ : t = A 80 + end;; 81 + [%%expect{| 82 + Line 4, characters 2-8: 83 + 4 | open M (* shadow constructor A *) 84 + ^^^^^^ 85 + Warning 45: this open statement shadows the constructor A (which is later used) 86 + Line 2, characters 2-13: 87 + 2 | type t0 = A (* unused type and constructor *) 88 + ^^^^^^^^^^^ 89 + Warning 34: unused type t0. 90 + Line 2, characters 2-13: 91 + 2 | type t0 = A (* unused type and constructor *) 92 + ^^^^^^^^^^^ 93 + Warning 37: unused constructor A. 94 + module T5 : sig end 95 + |}] 96 + 97 + 98 + module T1_bis : sig end = struct 99 + module M = struct type t end (* unused type t *) 100 + open! M (* unused open *) 101 + end;; 102 + [%%expect{| 103 + Line 2, characters 20-26: 104 + 2 | module M = struct type t end (* unused type t *) 105 + ^^^^^^ 106 + Warning 34: unused type t. 107 + Line 3, characters 2-9: 108 + 3 | open! M (* unused open *) 109 + ^^^^^^^ 110 + Warning 66: unused open! M. 111 + module T1_bis : sig end 112 + |}] 113 + 114 + module T2_bis : sig type s end = struct 115 + module M = struct type t end 116 + open! M (* used by line below *) 117 + type s = t 118 + end;; 119 + [%%expect{| 120 + module T2_bis : sig type s end 121 + |}] 122 + 123 + module T3_bis : sig end = struct 124 + type t0 = A (* unused type and constructor *) 125 + module M = struct type t = A end 126 + open! M (* used by line below; shadow constructor A (disabled) *) 127 + let _ = A (* A belongs to several types *) 128 + end;; 129 + [%%expect{| 130 + Line 2, characters 2-13: 131 + 2 | type t0 = A (* unused type and constructor *) 132 + ^^^^^^^^^^^ 133 + Warning 34: unused type t0. 134 + Line 2, characters 2-13: 135 + 2 | type t0 = A (* unused type and constructor *) 136 + ^^^^^^^^^^^ 137 + Warning 37: unused constructor A. 138 + module T3_bis : sig end 139 + |}] 140 + 141 + module T4_bis : sig end = struct 142 + type t0 = A 143 + module M = struct type t = A end (* unused type and constructor *) 144 + open! M (* unused open; no shadowing (A below refers to the one in t0) *) 145 + let _ : t0 = A (* disambiguation used *) 146 + end;; 147 + [%%expect{| 148 + Line 3, characters 20-30: 149 + 3 | module M = struct type t = A end (* unused type and constructor *) 150 + ^^^^^^^^^^ 151 + Warning 34: unused type t. 152 + Line 3, characters 20-30: 153 + 3 | module M = struct type t = A end (* unused type and constructor *) 154 + ^^^^^^^^^^ 155 + Warning 37: unused constructor A. 156 + Line 4, characters 2-9: 157 + 4 | open! M (* unused open; no shadowing (A below refers to the one in t0) *) 158 + ^^^^^^^ 159 + Warning 66: unused open! M. 160 + module T4_bis : sig end 161 + |}] 162 + 163 + module T5_bis : sig end = struct 164 + type t0 = A (* unused type and constructor *) 165 + module M = struct type t = A end 166 + open! M (* shadow constructor A (disabled) *) 167 + let _ : t = A 168 + end;; 169 + [%%expect{| 170 + Line 2, characters 2-13: 171 + 2 | type t0 = A (* unused type and constructor *) 172 + ^^^^^^^^^^^ 173 + Warning 34: unused type t0. 174 + Line 2, characters 2-13: 175 + 2 | type t0 = A (* unused type and constructor *) 176 + ^^^^^^^^^^^ 177 + Warning 37: unused constructor A. 178 + module T5_bis : sig end 179 + |}]
+4
testsuite/tests/warnings/w33.compilers.reference
··· 2 2 19 | let f M.(x) = x (* useless open *) 3 3 ^^^^^ 4 4 Warning 33: unused open M. 5 + File "w33.ml", line 26, characters 0-7: 6 + 26 | open! M (* useless open! *) 7 + ^^^^^^^ 8 + Warning 66: unused open! M. 5 9 File "w33.ml", line 27, characters 0-6: 6 10 27 | open M (* useless open *) 7 11 ^^^^^^
+1 -1
testsuite/tests/warnings/w33.ml
··· 23 23 open N (* used open *) 24 24 let i (A|B) = B 25 25 26 - open! M (* open! also deactivates unused open warning *) 26 + open! M (* useless open! *) 27 27 open M (* useless open *)
+24 -12
typing/env.ml
··· 2157 2157 ?(used_slot = ref false) 2158 2158 ?(loc = Location.none) ?(toplevel = false) 2159 2159 ovf root env = 2160 - if not toplevel && ovf = Asttypes.Fresh && not loc.Location.loc_ghost 2161 - && (Warnings.is_active (Warnings.Unused_open "") 2162 - || Warnings.is_active (Warnings.Open_shadow_identifier ("", "")) 2163 - || Warnings.is_active (Warnings.Open_shadow_label_constructor ("",""))) 2160 + let unused = 2161 + match ovf with 2162 + | Asttypes.Fresh -> Warnings.Unused_open (Path.name root) 2163 + | Asttypes.Override -> Warnings.Unused_open_bang (Path.name root) 2164 + in 2165 + let warn_unused = 2166 + Warnings.is_active unused 2167 + and warn_shadow_id = 2168 + Warnings.is_active (Warnings.Open_shadow_identifier ("", "")) 2169 + and warn_shadow_lc = 2170 + Warnings.is_active (Warnings.Open_shadow_label_constructor ("","")) 2171 + in 2172 + if not toplevel && not loc.Location.loc_ghost 2173 + && (warn_unused || warn_shadow_id || warn_shadow_lc) 2164 2174 then begin 2165 2175 let used = used_slot in 2166 - !add_delayed_check_forward 2167 - (fun () -> 2168 - if not !used then begin 2169 - used := true; 2170 - Location.prerr_warning loc (Warnings.Unused_open (Path.name root)) 2171 - end 2172 - ); 2176 + if warn_unused then 2177 + !add_delayed_check_forward 2178 + (fun () -> 2179 + if not !used then begin 2180 + used := true; 2181 + Location.prerr_warning loc unused 2182 + end 2183 + ); 2173 2184 let shadowed = ref [] in 2174 2185 let slot s b = 2175 2186 begin match check_shadowing env b with 2176 - | Some kind when not (List.mem (kind, s) !shadowed) -> 2187 + | Some kind when 2188 + ovf = Asttypes.Fresh && not (List.mem (kind, s) !shadowed) -> 2177 2189 shadowed := (kind, s) :: !shadowed; 2178 2190 let w = 2179 2191 match kind with
+6 -2
utils/warnings.ml
··· 90 90 | Erroneous_printed_signature of string (* 63 *) 91 91 | Unsafe_without_parsing (* 64 *) 92 92 | Redefining_unit of string (* 65 *) 93 + | Unused_open_bang of string (* 66 *) 93 94 ;; 94 95 95 96 (* If you remove a warning, leave a hole in the numbering. NEVER change ··· 164 165 | Erroneous_printed_signature _ -> 63 165 166 | Unsafe_without_parsing -> 64 166 167 | Redefining_unit _ -> 65 168 + | Unused_open_bang _ -> 66 167 169 ;; 168 170 169 - let last_warning_number = 65 171 + let last_warning_number = 66 170 172 ;; 171 173 172 174 (* Must be the max number returned by the [number] function. *) ··· 301 303 current := {error; active} 302 304 303 305 (* If you change these, don't forget to change them in man/ocamlc.m *) 304 - let defaults_w = "+a-4-6-7-9-27-29-32..42-44-45-48-50-60";; 306 + let defaults_w = "+a-4-6-7-9-27-29-32..42-44-45-48-50-60-66";; 305 307 let defaults_warn_error = "-a+31";; 306 308 307 309 let () = parse_options false defaults_w;; ··· 401 403 file1 file2 modname 402 404 | Unused_value_declaration v -> "unused value " ^ v ^ "." 403 405 | Unused_open s -> "unused open " ^ s ^ "." 406 + | Unused_open_bang s -> "unused open! " ^ s ^ "." 404 407 | Unused_type_declaration s -> "unused type " ^ s ^ "." 405 408 | Unused_for_index s -> "unused for-loop index " ^ s ^ "." 406 409 | Unused_ancestor s -> "unused ancestor variable " ^ s ^ "." ··· 661 664 63, "Erroneous printed signature"; 662 665 64, "-unsafe used with a preprocessor returning a syntax tree"; 663 666 65, "Type declaration defining a new '()' constructor"; 667 + 66, "Unused open! statement"; 664 668 ] 665 669 ;; 666 670
+1
utils/warnings.mli
··· 92 92 | Erroneous_printed_signature of string (* 63 *) 93 93 | Unsafe_without_parsing (* 64 *) 94 94 | Redefining_unit of string (* 65 *) 95 + | Unused_open_bang of string (* 66 *) 95 96 ;; 96 97 97 98 val parse_options : bool -> string -> unit;;