summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorValentin Gatien-Baron <valentin.gatienbaron@gmail.com>2018-07-15 15:00:47 -0400
committerValentin Gatien-Baron <valentin.gatienbaron@gmail.com>2018-07-15 15:00:47 -0400
commit0444eac687ef803a63f39081039784f33bc535eb (patch)
treebd4638705d3e1c59c3a9102339650490db038ae1 /driver
parent47eeff4bac81e710489147bbff41d23d38d4d5c2 (diff)
downloadocaml-0444eac687ef803a63f39081039784f33bc535eb.tar.gz
Print warnings on the warnings formatter in the couple of places that don't
Except the OCAMLPARAM stuff, as that runs before the command line warning settings are even parsed, so while they are reported using the normal warnings code, they don't look like normal warnings.
Diffstat (limited to 'driver')
-rw-r--r--driver/compmisc.ml4
-rw-r--r--driver/compmisc.mli2
-rw-r--r--driver/main.ml9
-rw-r--r--driver/optmain.ml2
4 files changed, 8 insertions, 9 deletions
diff --git a/driver/compmisc.ml b/driver/compmisc.ml
index 9177076ac1..2869db0d43 100644
--- a/driver/compmisc.ml
+++ b/driver/compmisc.ml
@@ -57,11 +57,11 @@ let initial_env () =
~initially_opened_module
~open_implicit_modules:(List.rev !Clflags.open_modules)
-let read_color_env ppf =
+let read_color_env () =
try
match Clflags.parse_color_setting (Sys.getenv "OCAML_COLOR") with
| None ->
- Location.print_warning Location.none ppf
+ Location.prerr_warning Location.none
(Warnings.Bad_env_variable
("OCAML_COLOR",
"expected \"auto\", \"always\" or \"never\""));
diff --git a/driver/compmisc.mli b/driver/compmisc.mli
index 3dbcdaebdd..fb29ff57c1 100644
--- a/driver/compmisc.mli
+++ b/driver/compmisc.mli
@@ -16,4 +16,4 @@
val init_path : ?dir:string -> bool -> unit
val initial_env : unit -> Env.t
-val read_color_env : Format.formatter -> unit
+val read_color_env : unit -> unit
diff --git a/driver/main.ml b/driver/main.ml
index a9a7e1650a..e9567a46f4 100644
--- a/driver/main.ml
+++ b/driver/main.ml
@@ -134,7 +134,7 @@ let main () =
try
readenv ppf Before_args;
Clflags.parse_arguments anonymous usage;
- Compmisc.read_color_env ppf;
+ Compmisc.read_color_env ();
begin try
Compenv.process_deferred_actions
(ppf,
@@ -162,8 +162,7 @@ let main () =
if !make_archive then begin
Compmisc.init_path false;
- Bytelibrarian.create_archive ppf
- (Compenv.get_objfiles ~with_ocamlparam:false)
+ Bytelibrarian.create_archive (Compenv.get_objfiles ~with_ocamlparam:false)
(extract_output !output_name);
Warnings.check_fatal ();
end
@@ -171,7 +170,7 @@ let main () =
Compmisc.init_path false;
let extracted_output = extract_output !output_name in
let revd = get_objfiles ~with_ocamlparam:false in
- Bytepackager.package_files ppf (Compmisc.initial_env ())
+ Bytepackager.package_files (Compmisc.initial_env ())
revd (extracted_output);
Warnings.check_fatal ();
end
@@ -193,7 +192,7 @@ let main () =
default_output !output_name
in
Compmisc.init_path false;
- Bytelink.link ppf (get_objfiles ~with_ocamlparam:true) target;
+ Bytelink.link (get_objfiles ~with_ocamlparam:true) target;
Warnings.check_fatal ();
end;
with x ->
diff --git a/driver/optmain.ml b/driver/optmain.ml
index 7ae30b28b9..0255e8fea7 100644
--- a/driver/optmain.ml
+++ b/driver/optmain.ml
@@ -247,7 +247,7 @@ let main () =
"<options> Compute dependencies \
(use 'ocamlopt -depend -help' for details)"];
Clflags.parse_arguments anonymous usage;
- Compmisc.read_color_env ppf;
+ Compmisc.read_color_env ();
if !gprofile && not Config.profiling then
fatal "Profiling with \"gprof\" is not supported on this platform.";
begin try