From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 30927BC2F for ; Fri, 26 Nov 2004 18:01:37 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAQH1aVX007314 for ; Fri, 26 Nov 2004 18:01:37 +0100 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 SAA11743 for ; Fri, 26 Nov 2004 18:01:35 +0100 (MET) Received: from [IPv6:::1] (yquem.inria.fr [128.93.8.37]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAQH1YJe007303 for ; Fri, 26 Nov 2004 18:01:35 +0100 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20041126.142525.93385094.garrigue@math.nagoya-u.ac.jp> References: <1101427906.9291.107.camel@pelican.wigram> <20041126.094412.30442729.garrigue@math.nagoya-u.ac.jp> <1101438486.9291.138.camel@pelican.wigram> <20041126.142525.93385094.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Why doesn't ocamlopt detect a missing ; after failwith statement? Date: Fri, 26 Nov 2004 18:01:33 +0100 To: caml users X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 41A76170.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41A7616E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 ocamlopt:01 failwith:01 wrote:01 failwith:01 forall:01 foo:01 foo:01 26,:98 25,:98 doligez:01 doligez:01 graph:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Nov 26, 2004, at 06:25, Jacques Garrigue wrote: > I believe the problem with failwith is solvable, albeit rather > complicated. The idea is that you want to be warned when you apply a > function of type (\forall 'a. 'a) to something, because no such > function may exist, so that this application will never actually take > place. More generally, you want to output a warning whenever the computation of such a value is not immediately followed by a join in the control flow graph, because at that point you know you're compiling dead code. Then you would also get a warning for things like this: failwith "foo"; print_string "hello world" or f (a, b, failwith "foo", c, d) etc. Don't ask me to implement it, though. -- Damien