From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA11978 for caml-red; Fri, 4 Aug 2000 19:59:05 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA00325 for ; Fri, 4 Aug 2000 11:18:30 +0200 (MET DST) Received: from air.irisa.fr (air.irisa.fr [131.254.60.130]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e749IUb15136 for ; Fri, 4 Aug 2000 11:18:30 +0200 (MET DST) Received: from parate.irisa.fr (parate.irisa.fr [131.254.12.25]) by air.irisa.fr (8.9.3/8.9.3) with ESMTP id LAA14671; Fri, 4 Aug 2000 11:18:29 +0200 (MET DST) To: Norman Ramsey Cc: caml-list@inria.fr Subject: Re: change warning to error? References: <200008012145.RAA23945@labrador.eecs.harvard.edu> From: David.Mentre@irisa.fr (David=?iso-8859-1?q?_Mentr=E9?=) Date: 04 Aug 2000 11:18:28 +0200 In-Reply-To: Norman Ramsey's message of "Tue, 1 Aug 2000 17:45:44 -0400" Message-ID: User-Agent: Gnus/5.0805 (Gnus v5.8.5) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: weis@pauillac.inria.fr Norman Ramsey 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.