Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enable warning 27 in tools/ and fix occurrences. It's good to mark in…

… depend and untypeast parts which are explicitly ignored.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14794 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit 68ae2cc74b5871079ae618f34649ec0bcb1a47f5 1 parent 0875b3c
@alainfrisch alainfrisch authored
View
2  tools/Makefile.shared
@@ -18,7 +18,7 @@ CAMLOPT=$(CAMLRUN) ../ocamlopt -nostdlib -I ../stdlib
CAMLLEX=$(CAMLRUN) ../boot/ocamllex
INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \
-I ../driver -I ../toplevel
-COMPFLAGS= -strict-sequence -w +32..39 -warn-error A -safe-string $(INCLUDES)
+COMPFLAGS= -strict-sequence -w +27+32..39 -warn-error A -safe-string $(INCLUDES)
LINKFLAGS=$(INCLUDES)
all: ocamldep ocamlprof ocamlcp ocamloptp ocamlmktop ocamlmklib dumpobj \
View
4 tools/cmt2annot.ml
@@ -156,7 +156,7 @@ let gen_annot target_filename filename
match target_filename with
| None -> Some (filename ^ ".annot")
| Some "-" -> None
- | Some filename -> target_filename
+ | Some _ -> target_filename
in
let iterator = iterator cmt_use_summaries in
match cmt_annots with
@@ -189,7 +189,7 @@ let gen_ml target_filename filename cmt =
let target_filename = match target_filename with
None -> Some (filename ^ ext)
| Some "-" -> None
- | Some filename -> target_filename
+ | Some _ -> target_filename
in
let oc = match target_filename with
None -> None
View
14 tools/depend.ml
@@ -26,12 +26,12 @@ let rec addmodule bv lid =
Lident s ->
if not (StringSet.mem s bv)
then free_structure_names := StringSet.add s !free_structure_names
- | Ldot(l, s) -> addmodule bv l
+ | Ldot(l, _s) -> addmodule bv l
| Lapply(l1, l2) -> addmodule bv l1; addmodule bv l2
let add bv lid =
match lid.txt with
- Ldot(l, s) -> addmodule bv l
+ Ldot(l, _s) -> addmodule bv l
| _ -> ()
let addmodule bv lid = addmodule bv lid.txt
@@ -39,13 +39,13 @@ let addmodule bv lid = addmodule bv lid.txt
let rec add_type bv ty =
match ty.ptyp_desc with
Ptyp_any -> ()
- | Ptyp_var v -> ()
+ | Ptyp_var _ -> ()
| Ptyp_arrow(_, t1, t2) -> add_type bv t1; add_type bv t2
| Ptyp_tuple tl -> List.iter (add_type bv) tl
| Ptyp_constr(c, tl) -> add bv c; List.iter (add_type bv) tl
| Ptyp_object (fl, _) -> List.iter (fun (_, _, t) -> add_type bv t) fl
| Ptyp_class(c, tl) -> add bv c; List.iter (add_type bv) tl
- | Ptyp_alias(t, s) -> add_type bv t
+ | Ptyp_alias(t, _) -> add_type bv t
| Ptyp_variant(fl, _, _) ->
List.iter
(function Rtag(_,_,_,stl) -> List.iter (add_type bv) stl
@@ -179,10 +179,10 @@ let rec add_expr bv exp =
| Pexp_constraint(e1, ty2) ->
add_expr bv e1;
add_type bv ty2
- | Pexp_send(e, m) -> add_expr bv e
+ | Pexp_send(e, _m) -> add_expr bv e
| Pexp_new li -> add bv li
- | Pexp_setinstvar(v, e) -> add_expr bv e
- | Pexp_override sel -> List.iter (fun (s, e) -> add_expr bv e) sel
+ | Pexp_setinstvar(_v, e) -> add_expr bv e
+ | Pexp_override sel -> List.iter (fun (_s, e) -> add_expr bv e) sel
| Pexp_letmodule(id, m, e) ->
add_module bv m; add_expr (StringSet.add id.txt bv) e
| Pexp_assert (e) -> add_expr bv e
View
4 tools/dumpobj.ml
@@ -481,7 +481,7 @@ let print_reloc (info, pos) =
(* Print a .cmo file *)
-let dump_obj filename ic =
+let dump_obj ic =
let buffer = really_input_string ic (String.length cmo_magic_number) in
if buffer <> cmo_magic_number then begin
prerr_endline "Not an object file"; exit 2
@@ -557,7 +557,7 @@ let arg_fun filename =
begin try
objfile := false; dump_exe ic
with Bytesections.Bad_magic_number ->
- objfile := true; seek_in ic 0; dump_obj filename ic
+ objfile := true; seek_in ic 0; dump_obj ic
end;
close_in ic;
printf "## end of ocaml dump of %S\n%!" filename
View
5 tools/objinfo.ml
@@ -76,7 +76,7 @@ let print_cma_infos (lib : Cmo_format.library) =
printf "\n";
List.iter print_cmo_infos lib.lib_units
-let print_cmi_infos name sign crcs =
+let print_cmi_infos name crcs =
printf "Unit name: %s\n" name;
printf "Interfaces imported:\n";
List.iter print_name_crc crcs
@@ -212,8 +212,7 @@ let dump_obj filename =
end else if magic_number = cmi_magic_number then begin
let cmi = Cmi_format.input_cmi ic in
close_in ic;
- print_cmi_infos cmi.Cmi_format.cmi_name cmi.Cmi_format.cmi_sign
- cmi.Cmi_format.cmi_crcs
+ print_cmi_infos cmi.Cmi_format.cmi_name cmi.Cmi_format.cmi_crcs
end else if magic_number = cmx_magic_number then begin
let ui = (input_value ic : unit_infos) in
let crc = Digest.input ic in
View
4 tools/ocamlcp.ml
@@ -74,8 +74,8 @@ module Options = Main_args.Make_bytecomp_options (struct
let _open s = option_with_arg "-open" s
let _output_obj = option "-output-obj"
let _pack = option "-pack"
- let _pp s = incompatible "-pp"
- let _ppx s = incompatible "-ppx"
+ let _pp _s = incompatible "-pp"
+ let _ppx _s = incompatible "-ppx"
let _principal = option "-principal"
let _rectypes = option "-rectypes"
let _runtime_variant s = option_with_arg "-runtime-variant" s
View
8 tools/ocamldep.ml
@@ -201,7 +201,7 @@ let print_raw_dependencies source_file deps =
(* Process one file *)
-let report_err source_file exn =
+let report_err exn =
error_occurred := true;
match exn with
| Sys_error msg ->
@@ -228,7 +228,7 @@ let read_parse_and_extract parse_function extract_function magic source_file =
raise x
end
with x ->
- report_err source_file x;
+ report_err x;
Depend.StringSet.empty
let ml_file_dependencies source_file =
@@ -284,7 +284,7 @@ let mli_file_dependencies source_file =
print_raw_dependencies source_file extracted_deps
end else begin
let basename = Filename.chop_extension source_file in
- let (byt_deps, opt_deps) =
+ let (byt_deps, _opt_deps) =
Depend.StringSet.fold (find_dependency MLI)
extracted_deps ([], []) in
print_dependencies [basename ^ ".cmi"] byt_deps
@@ -305,7 +305,7 @@ let file_dependencies_as kind source_file =
| ML -> ml_file_dependencies source_file
| MLI -> mli_file_dependencies source_file
end
- with x -> report_err source_file x
+ with x -> report_err x
let file_dependencies source_file =
if List.exists (Filename.check_suffix source_file) !ml_synonyms then
View
4 tools/ocamloptp.ml
@@ -77,8 +77,8 @@ module Options = Main_args.Make_optcomp_options (struct
let _output_obj = option "-output-obj"
let _p = option "-p"
let _pack = option "-pack"
- let _pp s = incompatible "-pp"
- let _ppx s = incompatible "-ppx"
+ let _pp _s = incompatible "-pp"
+ let _ppx _s = incompatible "-ppx"
let _principal = option "-principal"
let _rectypes = option "-rectypes"
let _runtime_variant s = option_with_arg "-runtime-variant" s
View
12 tools/ocamlprof.ml
@@ -173,8 +173,8 @@ and rewrite_exp iflag sexp =
and rw_exp iflag sexp =
match sexp.pexp_desc with
- Pexp_ident lid -> ()
- | Pexp_constant cst -> ()
+ Pexp_ident _lid -> ()
+ | Pexp_constant _cst -> ()
| Pexp_let(_, spat_sexp_list, sbody) ->
rewrite_patexp_list iflag spat_sexp_list;
@@ -314,7 +314,7 @@ and rewrite_annotate_exp_list l =
l
and rewrite_function iflag = function
- | [{pc_lhs=spat; pc_guard=None;
+ | [{pc_lhs=_; pc_guard=None;
pc_rhs={pexp_desc = (Pexp_function _|Pexp_fun _)} as sexp}] ->
rewrite_exp iflag sexp
| l -> rewrite_funmatching l
@@ -371,11 +371,11 @@ and rewrite_class_declaration iflag cl =
and rewrite_mod iflag smod =
match smod.pmod_desc with
- Pmod_ident lid -> ()
+ Pmod_ident _ -> ()
| Pmod_structure sstr -> List.iter (rewrite_str_item iflag) sstr
- | Pmod_functor(param, smty, sbody) -> rewrite_mod iflag sbody
+ | Pmod_functor(_param, _smty, sbody) -> rewrite_mod iflag sbody
| Pmod_apply(smod1, smod2) -> rewrite_mod iflag smod1; rewrite_mod iflag smod2
- | Pmod_constraint(smod, smty) -> rewrite_mod iflag smod
+ | Pmod_constraint(smod, _smty) -> rewrite_mod iflag smod
| Pmod_unpack(sexp) -> rewrite_exp iflag sexp
| Pmod_extension _ -> ()
View
2  tools/profiling.ml
@@ -37,7 +37,7 @@ let dump_counters () =
then raise Bad_profile)
!counters prevl;
List.iter2
- (fun (curname, (_,curcount)) (prevname, (_,prevcount)) ->
+ (fun (_curname, (_,curcount)) (_prevname, (_,prevcount)) ->
for i = 0 to Array.length curcount - 1 do
curcount.(i) <- curcount.(i) + prevcount.(i)
done)
View
2  tools/untypeast.ml
@@ -166,7 +166,7 @@ and untype_extension_constructor ext =
Text_decl (args, ret) ->
Pext_decl (List.map untype_core_type args,
option untype_core_type ret)
- | Text_rebind (p, lid) -> Pext_rebind lid
+ | Text_rebind (_p, lid) -> Pext_rebind lid
);
pext_loc = ext.ext_loc;
pext_attributes = ext.ext_attributes;
Please sign in to comment.
Something went wrong with that request. Please try again.