summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--asmcomp/amd64/scheduling.ml2
-rw-r--r--asmcomp/amd64/selection.ml2
-rw-r--r--asmcomp/asmlink.ml1
-rw-r--r--asmcomp/asmpackager.ml3
-rw-r--r--asmcomp/cmmgen.ml3
-rw-r--r--asmcomp/compilenv.mli1
-rw-r--r--asmcomp/emitaux.ml3
-rw-r--r--asmcomp/interf.ml1
-rw-r--r--asmcomp/printclambda.ml1
-rw-r--r--asmcomp/schedgen.ml1
-rw-r--r--asmcomp/split.ml2
-rw-r--r--bytecomp/bytesections.ml2
-rw-r--r--bytecomp/matching.ml4
-rw-r--r--driver/optcompile.ml1
-rw-r--r--lex/Makefile2
-rw-r--r--lex/common.ml6
-rw-r--r--otherlibs/Makefile.shared2
-rw-r--r--otherlibs/dynlink/Makefile2
-rw-r--r--otherlibs/num/big_int.ml4
-rw-r--r--otherlibs/num/nat.ml2
-rw-r--r--otherlibs/systhreads/Makefile2
-rw-r--r--otherlibs/threads/Makefile2
-rw-r--r--otherlibs/threads/thread.ml5
-rw-r--r--otherlibs/threads/unix.ml5
-rw-r--r--parsing/location.ml4
-rwxr-xr-xstdlib/Makefile.shared2
-rw-r--r--stdlib/camlinternalOO.ml3
-rw-r--r--stdlib/filename.ml2
-rw-r--r--stdlib/parsing.ml3
-rw-r--r--stdlib/printexc.ml2
-rw-r--r--stdlib/weak.ml2
-rw-r--r--typing/parmatch.ml2
-rw-r--r--typing/typeclass.ml2
34 files changed, 42 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index 9436adb92..9f71e5310 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ include stdlib/StdlibModules
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
-COMPFLAGS=-strict-sequence -w +33 -warn-error A $(INCLUDES)
+COMPFLAGS=-strict-sequence -w +33..38 -warn-error A $(INCLUDES)
LINKFLAGS=
CAMLYACC=boot/ocamlyacc
diff --git a/asmcomp/amd64/scheduling.ml b/asmcomp/amd64/scheduling.ml
index 8ba88f4a7..1052a540d 100644
--- a/asmcomp/amd64/scheduling.ml
+++ b/asmcomp/amd64/scheduling.ml
@@ -12,7 +12,7 @@
(* $Id$ *)
-open Schedgen (* to create a dependency *)
+let _ = let module M = Schedgen in () (* to create a dependency *)
(* Scheduling is turned off because the processor schedules dynamically
much better than what we could do. *)
diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml
index 9c4464aed..9953b73a6 100644
--- a/asmcomp/amd64/selection.ml
+++ b/asmcomp/amd64/selection.ml
@@ -14,11 +14,9 @@
(* Instruction selection for the AMD64 *)
-open Misc
open Arch
open Proc
open Cmm
-open Reg
open Mach
(* Auxiliary for recognizing addressing modes *)
diff --git a/asmcomp/asmlink.ml b/asmcomp/asmlink.ml
index e99e62a39..fe78bd02c 100644
--- a/asmcomp/asmlink.ml
+++ b/asmcomp/asmlink.ml
@@ -14,7 +14,6 @@
(* Link a set of .cmx/.o files and produce an executable *)
-open Sys
open Misc
open Config
open Cmx_format
diff --git a/asmcomp/asmpackager.ml b/asmcomp/asmpackager.ml
index 3f44a0a98..0fc89866f 100644
--- a/asmcomp/asmpackager.ml
+++ b/asmcomp/asmpackager.ml
@@ -15,10 +15,7 @@
(* "Package" a set of .cmx/.o files into one .cmx/.o file having the
original compilation units as sub-modules. *)
-open Printf
open Misc
-open Lambda
-open Clambda
open Cmx_format
type error =
diff --git a/asmcomp/cmmgen.ml b/asmcomp/cmmgen.ml
index d29f8c67c..5a3bac2a1 100644
--- a/asmcomp/cmmgen.ml
+++ b/asmcomp/cmmgen.ml
@@ -18,7 +18,6 @@ open Misc
open Arch
open Asttypes
open Primitive
-open Types
open Lambda
open Clambda
open Cmm
@@ -714,8 +713,6 @@ let simplif_primitive p =
let transl_isout h arg = tag_int (Cop(Ccmpa Clt, [h ; arg]))
-exception Found of int
-
let make_switch_gen arg cases acts =
let lcases = Array.length cases in
let new_cases = Array.create lcases 0 in
diff --git a/asmcomp/compilenv.mli b/asmcomp/compilenv.mli
index 3e4d83e20..eeab477f2 100644
--- a/asmcomp/compilenv.mli
+++ b/asmcomp/compilenv.mli
@@ -14,7 +14,6 @@
(* Compilation environments for compilation units *)
-open Clambda
open Cmx_format
val reset: ?packname:string -> string -> unit
diff --git a/asmcomp/emitaux.ml b/asmcomp/emitaux.ml
index 4013c4674..8241592f5 100644
--- a/asmcomp/emitaux.ml
+++ b/asmcomp/emitaux.ml
@@ -15,9 +15,6 @@
(* Common functions for emitting assembly code *)
open Debuginfo
-open Cmm
-open Reg
-open Linearize
let output_channel = ref stdout
diff --git a/asmcomp/interf.ml b/asmcomp/interf.ml
index f22672b55..aa71ebd38 100644
--- a/asmcomp/interf.ml
+++ b/asmcomp/interf.ml
@@ -18,7 +18,6 @@
module IntPairSet =
Set.Make(struct type t = int * int let compare = compare end)
-open Misc
open Reg
open Mach
diff --git a/asmcomp/printclambda.ml b/asmcomp/printclambda.ml
index 3d89f5020..fdb048d7f 100644
--- a/asmcomp/printclambda.ml
+++ b/asmcomp/printclambda.ml
@@ -14,7 +14,6 @@
open Format
open Asttypes
open Clambda
-open Debuginfo
let rec pr_idents ppf = function
| [] -> ()
diff --git a/asmcomp/schedgen.ml b/asmcomp/schedgen.ml
index 89c031d1b..9bf93af00 100644
--- a/asmcomp/schedgen.ml
+++ b/asmcomp/schedgen.ml
@@ -14,7 +14,6 @@
(* Instruction scheduling *)
-open Misc
open Reg
open Mach
open Linearize
diff --git a/asmcomp/split.ml b/asmcomp/split.ml
index da5cdf1f5..a7effdda3 100644
--- a/asmcomp/split.ml
+++ b/asmcomp/split.ml
@@ -21,7 +21,7 @@ open Mach
type subst = Reg.t Reg.Map.t
-let subst_reg r sub =
+let subst_reg r (sub : subst) =
try
Reg.Map.find r sub
with Not_found ->
diff --git a/bytecomp/bytesections.ml b/bytecomp/bytesections.ml
index 518e2254f..17d57f9ed 100644
--- a/bytecomp/bytesections.ml
+++ b/bytecomp/bytesections.ml
@@ -52,7 +52,7 @@ let read_toc ic =
if header <> Config.exec_magic_number then raise Bad_magic_number;
seek_in ic (pos_trailer - 8 * num_sections);
section_table := [];
- for i = 1 to num_sections do
+ for _i = 1 to num_sections do
let name = Misc.input_bytes ic 4 in
let len = input_binary_int ic in
section_table := (name, len) :: !section_table
diff --git a/bytecomp/matching.ml b/bytecomp/matching.ml
index f0b223747..144d01688 100644
--- a/bytecomp/matching.ml
+++ b/bytecomp/matching.ml
@@ -274,9 +274,9 @@ let ctx_match ctx pss =
pss)
ctx
-type jumps = (int * ctx ) list
+type jumps = (int * ctx list) list
-let pretty_jumps env = match env with
+let pretty_jumps (env : jumps) = match env with
| [] -> ()
| _ ->
List.iter
diff --git a/driver/optcompile.ml b/driver/optcompile.ml
index 16be592d6..a796bbe1e 100644
--- a/driver/optcompile.ml
+++ b/driver/optcompile.ml
@@ -17,7 +17,6 @@
open Misc
open Config
open Format
-open Typedtree
(* Initialize the search path.
The current directory is always searched first,
diff --git a/lex/Makefile b/lex/Makefile
index e12eaa83d..424e0d0b0 100644
--- a/lex/Makefile
+++ b/lex/Makefile
@@ -15,7 +15,7 @@
# The lexer generator
CAMLC=../boot/ocamlrun ../boot/ocamlc -strict-sequence -nostdlib -I ../boot
CAMLOPT=../boot/ocamlrun ../ocamlopt -nostdlib -I ../stdlib
-COMPFLAGS=-w +33 -warn-error A
+COMPFLAGS=-w +33..38 -warn-error A
CAMLYACC=../boot/ocamlyacc
YACCFLAGS=-v
CAMLLEX=../boot/ocamlrun ../boot/ocamllex
diff --git a/lex/common.ml b/lex/common.ml
index 5638185d0..d52cbb94c 100644
--- a/lex/common.ml
+++ b/lex/common.ml
@@ -58,7 +58,7 @@ let copy_chars_unix ic oc start stop =
done
let copy_chars_win32 ic oc start stop =
- for i = start to stop - 1 do
+ for _i = start to stop - 1 do
let c = input_char ic in
if c <> '\r' then output_char oc c
done
@@ -72,10 +72,10 @@ let copy_chunk sourcefile ic oc trl loc add_parens =
if loc.start_pos < loc.end_pos || add_parens then begin
fprintf oc "# %d \"%s\"\n" loc.start_line sourcefile;
if add_parens then begin
- for i = 1 to loc.start_col - 1 do output_char oc ' ' done;
+ for _i = 1 to loc.start_col - 1 do output_char oc ' ' done;
output_char oc '(';
end else begin
- for i = 1 to loc.start_col do output_char oc ' ' done;
+ for _i = 1 to loc.start_col do output_char oc ' ' done;
end;
seek_in ic loc.start_pos;
copy_chars ic oc loc.start_pos loc.end_pos;
diff --git a/otherlibs/Makefile.shared b/otherlibs/Makefile.shared
index e7f94f1fa..b10129212 100644
--- a/otherlibs/Makefile.shared
+++ b/otherlibs/Makefile.shared
@@ -21,7 +21,7 @@ include $(ROOTDIR)/config/Makefile
# Compilation options
CC=$(BYTECC)
CAMLRUN=$(ROOTDIR)/boot/ocamlrun
-COMPFLAGS=-w +33 -warn-error A -g $(EXTRACAMLFLAGS)
+COMPFLAGS=-w +33..88 -warn-error A -g $(EXTRACAMLFLAGS)
MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib
# Variables to be defined by individual libraries:
diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
index e9d0a5a21..d86351d16 100644
--- a/otherlibs/dynlink/Makefile
+++ b/otherlibs/dynlink/Makefile
@@ -20,7 +20,7 @@ include ../../config/Makefile
CAMLC=../../boot/ocamlrun ../../ocamlc
CAMLOPT=../../ocamlcompopt.sh
INCLUDES=-I ../../utils -I ../../typing -I ../../bytecomp -I ../../asmcomp
-COMPFLAGS=-w +33 -warn-error A -I ../../stdlib $(INCLUDES)
+COMPFLAGS=-w +33..38 -warn-error A -I ../../stdlib $(INCLUDES)
OBJS=dynlinkaux.cmo dynlink.cmo
diff --git a/otherlibs/num/big_int.ml b/otherlibs/num/big_int.ml
index 34de4b127..e54c795cf 100644
--- a/otherlibs/num/big_int.ml
+++ b/otherlibs/num/big_int.ml
@@ -453,7 +453,7 @@ let power_base_nat base nat off len =
and l = num_bits_int n - 2 in
let p = ref (1 lsl l) in
blit_nat res 0 power_base pmax 1;
- for i = l downto 0 do
+ for _i = l downto 0 do
let len = num_digits_nat res 0 n in
let len2 = min n (2 * len) in
let succ_len2 = succ len2 in
@@ -498,7 +498,7 @@ let power_big_int_positive_int bi n =
and l = num_bits_int n - 2 in
let p = ref (1 lsl l) in
blit_nat res 0 bi.abs_value 0 bi_len;
- for i = l downto 0 do
+ for _i = l downto 0 do
let len = num_digits_nat res 0 res_len in
let len2 = min res_len (2 * len) in
set_to_zero_nat res2 0 len2;
diff --git a/otherlibs/num/nat.ml b/otherlibs/num/nat.ml
index 44742a213..c86df5318 100644
--- a/otherlibs/num/nat.ml
+++ b/otherlibs/num/nat.ml
@@ -372,7 +372,7 @@ let power_base_int base i =
and l = num_bits_int n - 2 in
let p = ref (1 lsl l) in
blit_nat res 0 power_base pmax 1;
- for i = l downto 0 do
+ for _i = l downto 0 do
let len = num_digits_nat res 0 newn in
let len2 = min n (2 * len) in
let succ_len2 = succ len2 in
diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
index 716da79c9..41d9ba50a 100644
--- a/otherlibs/systhreads/Makefile
+++ b/otherlibs/systhreads/Makefile
@@ -18,7 +18,7 @@ include ../../config/Makefile
CAMLC=../../ocamlcomp.sh -I ../unix
CAMLOPT=../../ocamlcompopt.sh -I ../unix
MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
-COMPFLAGS=-w +33 -warn-error A -g
+COMPFLAGS=-w +33..38 -warn-error A -g
BYTECODE_C_OBJS=st_stubs_b.o
NATIVECODE_C_OBJS=st_stubs_n.o
diff --git a/otherlibs/threads/Makefile b/otherlibs/threads/Makefile
index 93651d8dc..7abf74aaa 100644
--- a/otherlibs/threads/Makefile
+++ b/otherlibs/threads/Makefile
@@ -19,7 +19,7 @@ CC=$(BYTECC)
CFLAGS=-I../../byterun -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
CAMLC=../../ocamlcomp.sh -I ../unix
MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
-COMPFLAGS=-w +33 -warn-error A
+COMPFLAGS=-w +33..38 -warn-error A
C_OBJS=scheduler.o
diff --git a/otherlibs/threads/thread.ml b/otherlibs/threads/thread.ml
index f4bbd8a5a..e3de604d2 100644
--- a/otherlibs/threads/thread.ml
+++ b/otherlibs/threads/thread.ml
@@ -28,6 +28,11 @@ type resumption_status =
Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
| Resumed_wait of int * Unix.process_status
+(* to avoid warning *)
+let _ = [Resumed_wakeup; Resumed_delay; Resumed_join;
+ Resumed_io; Resumed_select ([], [], []);
+ Resumed_wait (0, Unix.WEXITED 0)]
+
(* It is mucho important that the primitives that reschedule are called
through an ML function call, not directly. That's because when such a
primitive returns, the bytecode interpreter is only semi-obedient:
diff --git a/otherlibs/threads/unix.ml b/otherlibs/threads/unix.ml
index 609c098a3..490facc76 100644
--- a/otherlibs/threads/unix.ml
+++ b/otherlibs/threads/unix.ml
@@ -36,6 +36,11 @@ type resumption_status =
| Resumed_select of file_descr list * file_descr list * file_descr list
| Resumed_wait of int * process_status
+(* to avoid warning *)
+let _ = [Resumed_wakeup; Resumed_delay; Resumed_join;
+ Resumed_io; Resumed_select ([], [], []);
+ Resumed_wait (0, WEXITED 0)]
+
external thread_initialize : unit -> unit = "thread_initialize"
external thread_wait_read : file_descr -> unit = "thread_wait_read"
external thread_wait_write : file_descr -> unit = "thread_wait_write"
diff --git a/parsing/location.ml b/parsing/location.ml
index 561a9060c..5be3b69c2 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -156,10 +156,10 @@ let highlight_dumb ppf lb loc =
if !line = !line_start && !line = !line_end then begin
(* loc is on one line: underline location *)
Format.fprintf ppf "@. ";
- for i = !pos_at_bol to loc.loc_start.pos_cnum - 1 do
+ for _i = !pos_at_bol to loc.loc_start.pos_cnum - 1 do
Format.pp_print_char ppf ' '
done;
- for i = loc.loc_start.pos_cnum to loc.loc_end.pos_cnum - 1 do
+ for _i = loc.loc_start.pos_cnum to loc.loc_end.pos_cnum - 1 do
Format.pp_print_char ppf '^'
done
end;
diff --git a/stdlib/Makefile.shared b/stdlib/Makefile.shared
index daf266268..b94c481d4 100755
--- a/stdlib/Makefile.shared
+++ b/stdlib/Makefile.shared
@@ -17,7 +17,7 @@ include ../config/Makefile
RUNTIME=../boot/ocamlrun
COMPILER=../ocamlc
CAMLC=$(RUNTIME) $(COMPILER)
-COMPFLAGS=-strict-sequence -w +33 -g -warn-error A -nostdlib
+COMPFLAGS=-strict-sequence -w +33..38 -g -warn-error A -nostdlib
OPTCOMPILER=../ocamlopt
CAMLOPT=$(RUNTIME) $(OPTCOMPILER)
OPTCOMPFLAGS=-warn-error A -nostdlib -g
diff --git a/stdlib/camlinternalOO.ml b/stdlib/camlinternalOO.ml
index 6d7871465..1abb7e550 100644
--- a/stdlib/camlinternalOO.ml
+++ b/stdlib/camlinternalOO.ml
@@ -58,6 +58,7 @@ let initial_object_size = 2
(**** Items ****)
type item = DummyA | DummyB | DummyC of int
+let _ = [DummyA; DummyB; DummyC 0] (* to avoid warnings *)
let dummy_item = (magic () : item)
@@ -67,6 +68,8 @@ type tag
type label = int
type closure = item
type t = DummyA | DummyB | DummyC of int
+let _ = [DummyA; DummyB; DummyC 0] (* to avoid warnings *)
+
type obj = t array
external ret : (obj -> 'a) -> closure = "%identity"
diff --git a/stdlib/filename.ml b/stdlib/filename.ml
index 950a7b39f..89a349df3 100644
--- a/stdlib/filename.ml
+++ b/stdlib/filename.ml
@@ -132,7 +132,7 @@ module Win32 = struct
| '\\' -> loop_bs (n+1) (i+1);
| c -> add_bs n; loop i
end
- and add_bs n = for j = 1 to n do Buffer.add_char b '\\'; done
+ and add_bs n = for _j = 1 to n do Buffer.add_char b '\\'; done
in
loop 0;
Buffer.contents b
diff --git a/stdlib/parsing.ml b/stdlib/parsing.ml
index 55a8f53aa..a10ffe2c1 100644
--- a/stdlib/parsing.ml
+++ b/stdlib/parsing.ml
@@ -74,6 +74,9 @@ type parser_output =
| Compute_semantic_action
| Call_error_function
+(* to avoid warnings *)
+let _ = [Read_token; Raise_parse_error; Grow_stacks_1; Grow_stacks_2; Compute_semantic_action; Call_error_function]
+
external parse_engine :
parse_tables -> parser_env -> parser_input -> Obj.t -> parser_output
= "caml_parse_engine"
diff --git a/stdlib/printexc.ml b/stdlib/printexc.ml
index 062decb85..f244009ba 100644
--- a/stdlib/printexc.ml
+++ b/stdlib/printexc.ml
@@ -88,6 +88,8 @@ type loc_info =
* int (* end char *)
| Unknown_location of bool (*is_raise*)
+let _ = [Known_location (false, "", 0, 0, 0); Unknown_location false]
+
external get_exception_backtrace:
unit -> loc_info array option = "caml_get_exception_backtrace"
diff --git a/stdlib/weak.ml b/stdlib/weak.ml
index bbd3debc4..ab0bab0f6 100644
--- a/stdlib/weak.ml
+++ b/stdlib/weak.ml
@@ -209,7 +209,7 @@ module Make (H : Hashtbl.HashedType) : (S with type data = H.t) = struct
t.hashes.(index) <- newhashes;
if sz <= t.limit && newsz > t.limit then begin
t.oversize <- t.oversize + 1;
- for i = 0 to over_limit do test_shrink_bucket t done;
+ for _i = 0 to over_limit do test_shrink_bucket t done;
end;
if t.oversize > Array.length t.table / over_limit then resize t;
end else if check bucket i then begin
diff --git a/typing/parmatch.ml b/typing/parmatch.ml
index 99bb5afe9..a0cb5f3d8 100644
--- a/typing/parmatch.ml
+++ b/typing/parmatch.ml
@@ -1223,7 +1223,7 @@ let pretty_line ps =
prerr_string ">")
ps
-let pretty_matrix pss =
+let pretty_matrix (pss : matrix) =
prerr_endline "begin matrix" ;
List.iter
(fun ps ->
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
index 232fca860..4d2e0ab84 100644
--- a/typing/typeclass.ml
+++ b/typing/typeclass.ml
@@ -994,7 +994,7 @@ let rec approx_description ct =
let temp_abbrev loc env id arity =
let params = ref [] in
- for i = 1 to arity do
+ for _i = 1 to arity do
params := Ctype.newvar () :: !params
done;
let ty = Ctype.newobj (Ctype.newvar ()) in