* change warning to error?
@ 2000-08-01 21:45 Norman Ramsey
2000-08-02 17:03 ` Hendrik Tews
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Norman Ramsey @ 2000-08-01 21:45 UTC (permalink / raw)
To: caml-list
Is it possible to instruct ocamlc that the `partial match' warning
should be treated as an error, i.e., that it stop compilation and
produce no output? In using SML/NJ, I have found this option extremely
useful---I don't have to worry about overlooking a warning in six
pages of compiler output.
Norman
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: change warning to error?
2000-08-01 21:45 change warning to error? Norman Ramsey
@ 2000-08-02 17:03 ` Hendrik Tews
2000-08-02 22:10 ` John Max Skaller
2000-08-04 9:18 ` David Mentré
2 siblings, 0 replies; 4+ messages in thread
From: Hendrik Tews @ 2000-08-02 17:03 UTC (permalink / raw)
To: caml-list
Norman Ramsey writes:
From: Norman Ramsey <nr@eecs.harvard.edu>
Date: Tue, 1 Aug 2000 17:45:44 -0400
Subject: change warning to error?
Is it possible to instruct ocamlc that the `partial match' warning
should be treated as an error, i.e., that it stop compilation and
produce no output? In using SML/NJ, I have found this option extremely
useful---I don't have to worry about overlooking a warning in six
pages of compiler output.
What about compiling from emacs and using C-x ` to step through
all errors and warnings?
Bye,
Hendrik
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: change warning to error?
2000-08-01 21:45 change warning to error? Norman Ramsey
2000-08-02 17:03 ` Hendrik Tews
@ 2000-08-02 22:10 ` John Max Skaller
2000-08-04 9:18 ` David Mentré
2 siblings, 0 replies; 4+ messages in thread
From: John Max Skaller @ 2000-08-02 22:10 UTC (permalink / raw)
To: Norman Ramsey; +Cc: caml-list
Norman Ramsey wrote:
>
> Is it possible to instruct ocamlc that the `partial match' warning
> should be treated as an error, i.e., that it stop compilation and
> produce no output? In using SML/NJ, I have found this option extremely
> useful---I don't have to worry about overlooking a warning in six
> pages of compiler output.
I agree this would be useful, although my problem is different:
when I compile some modules that get this warning, I _expect_
it due to changes in earlier type declarations, but I'm not up
to working on it. The problem is that a subsequent 'make' will not
recompile the module because it was previously successful.
So I don't even get to look through six pages of warnings: the whole
build looks clean. (I have to 'make clean' to see the problem,
which I may forget to do).
--
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: change warning to error?
2000-08-01 21:45 change warning to error? Norman Ramsey
2000-08-02 17:03 ` Hendrik Tews
2000-08-02 22:10 ` John Max Skaller
@ 2000-08-04 9:18 ` David Mentré
2 siblings, 0 replies; 4+ messages in thread
From: David Mentré @ 2000-08-04 9:18 UTC (permalink / raw)
To: Norman Ramsey; +Cc: caml-list
Norman Ramsey <nr@eecs.harvard.edu> writes:
> Is it possible to instruct ocamlc that the `partial match' warning
> should be treated as an error, i.e., that it stop compilation and
> produce no output?
It's free software, so "Use the source Luke". ;)
After applying the follwing patch:
----
Objective Caml version 3.00-abort-partial-match
# let is_zero 0 =true;;
Warning: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
1
Interrupted.
#
----
--- ocaml-3.00/parsing/location.ml Mon Mar 6 23:11:37 2000
+++ ocaml-3.00-modif/parsing/location.ml Fri Aug 4 11:04:07 2000
@@ -116,8 +116,14 @@
let print_warning loc ppf w =
if Warnings.is_active w then begin
- fprintf ppf "%aWarning: %s@." print loc (Warnings.message w);
- incr num_loc_lines;
+ match w with
+ | Warnings.Partial_match err -> (
+ fprintf ppf "%aWarning: %s@." print loc (Warnings.message w);
+ raise Sys.Break
+ )
+ | _ ->
+ fprintf ppf "%aWarning: %s@." print loc (Warnings.message w);
+ incr num_loc_lines;
end
;;
Only in ocaml-3.00-modif/stdlib: caml
diff -cru ocaml-3.00/utils/config.mlp ocaml-3.00-modif/utils/config.mlp
--- ocaml-3.00/utils/config.mlp Fri Apr 21 13:54:35 2000
+++ ocaml-3.00-modif/utils/config.mlp Fri Aug 4 11:11:55 2000
@@ -12,7 +12,7 @@
(* $Id: config.mlp,v 1.132 2000/04/21 11:54:35 xleroy Exp $ *)
-let version = "3.00"
+let version = "3.00-abort-partial-match"
let standard_library =
try
Best regards,
--
David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/
Opinions expressed here are only mine.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-08-04 17:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-01 21:45 change warning to error? Norman Ramsey
2000-08-02 17:03 ` Hendrik Tews
2000-08-02 22:10 ` John Max Skaller
2000-08-04 9:18 ` David Mentré
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox