diff options
| author | Alain Frisch <alain@frisch.fr> | 2014-05-12 10:41:21 +0000 |
|---|---|---|
| committer | Alain Frisch <alain@frisch.fr> | 2014-05-12 10:41:21 +0000 |
| commit | 68ae2cc74b5871079ae618f34649ec0bcb1a47f5 (patch) | |
| tree | fd6c69628d1f22843d0fb3a6250c043aa1e19fcd /tools | |
| parent | 0875b3c630e9ddb711c7d8cf6f0f5c0a751ef926 (diff) | |
| download | ocaml-68ae2cc74b5871079ae618f34649ec0bcb1a47f5.tar.gz | |
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
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/Makefile.shared | 2 | ||||
| -rw-r--r-- | tools/cmt2annot.ml | 4 | ||||
| -rw-r--r-- | tools/depend.ml | 14 | ||||
| -rw-r--r-- | tools/dumpobj.ml | 4 | ||||
| -rw-r--r-- | tools/objinfo.ml | 5 | ||||
| -rw-r--r-- | tools/ocamlcp.ml | 4 | ||||
| -rw-r--r-- | tools/ocamldep.ml | 8 | ||||
| -rw-r--r-- | tools/ocamloptp.ml | 4 | ||||
| -rw-r--r-- | tools/ocamlprof.ml | 12 | ||||
| -rw-r--r-- | tools/profiling.ml | 2 | ||||
| -rw-r--r-- | tools/untypeast.ml | 2 |
11 files changed, 30 insertions, 31 deletions
diff --git a/tools/Makefile.shared b/tools/Makefile.shared index 2b19278486..c4c903030e 100644 --- a/tools/Makefile.shared +++ b/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 \ diff --git a/tools/cmt2annot.ml b/tools/cmt2annot.ml index 13fb2b1c9d..eee0c79065 100644 --- a/tools/cmt2annot.ml +++ b/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 diff --git a/tools/depend.ml b/tools/depend.ml index caf7cc158d..c6dc14330d 100644 --- a/tools/depend.ml +++ b/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 diff --git a/tools/dumpobj.ml b/tools/dumpobj.ml index 37bafa3afc..d95c210da4 100644 --- a/tools/dumpobj.ml +++ b/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 diff --git a/tools/objinfo.ml b/tools/objinfo.ml index 3eaafcca73..07ede889a8 100644 --- a/tools/objinfo.ml +++ b/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 diff --git a/tools/ocamlcp.ml b/tools/ocamlcp.ml index 4b60e96b65..5c90c8d0f0 100644 --- a/tools/ocamlcp.ml +++ b/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 diff --git a/tools/ocamldep.ml b/tools/ocamldep.ml index ea09c08036..c623ff73d3 100644 --- a/tools/ocamldep.ml +++ b/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 diff --git a/tools/ocamloptp.ml b/tools/ocamloptp.ml index 842651a135..178f7c2d25 100644 --- a/tools/ocamloptp.ml +++ b/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 diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml index 457192eb6b..9c2bb489dd 100644 --- a/tools/ocamlprof.ml +++ b/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 _ -> () diff --git a/tools/profiling.ml b/tools/profiling.ml index 5dae8e4614..49a84108ec 100644 --- a/tools/profiling.ml +++ b/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) diff --git a/tools/untypeast.ml b/tools/untypeast.ml index 818c7259bd..19cf6bdc90 100644 --- a/tools/untypeast.ml +++ b/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; |
