summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-05-15 13:27:15 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-05-15 13:27:15 +0000
commit58d10b597a0bc248ae3c646b84d0209981d220cb (patch)
tree6c4946996d75c6da67a70a88b0b58ffe932520b3
parent553ad406297bc50342e60d2aa434ef93116e3c87 (diff)
Sortir les warnings sur stderr si pas au toplevel.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1557 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--parsing/location.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/parsing/location.ml b/parsing/location.ml
index 4d09a2e60..0bdcd3232 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -119,7 +119,6 @@ let (msg_file, msg_line, msg_chars, msg_to, msg_colon, warn_head) =
match Sys.os_type with
| "MacOS" -> ("File \"", "\"; line ", "; characters ", " to ", "", "### ")
| _ -> ("File \"", "\", line ", ", characters ", "-", ":", "")
-;;
let print loc =
if String.length !input_name = 0 then
@@ -141,12 +140,14 @@ let print loc =
end
let print_warning loc msg =
+ if not !Sys.interactive then Format.set_formatter_out_channel stderr;
print loc;
print_string warn_head;
print_string "Warning: "; print_string msg; print_newline();
- incr num_loc_lines
+ incr num_loc_lines;
+ if not !Sys.interactive then Format.set_formatter_out_channel stdout
let echo_eof () =
print_newline ();
incr num_loc_lines
-;;
+