From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id ABAB4BC2F for ; Mon, 29 Nov 2004 08:53:03 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAT7r3e7025336 for ; Mon, 29 Nov 2004 08:53:03 +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 IAA15555 for ; Mon, 29 Nov 2004 08:53:03 +0100 (MET) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAT7r1jS032199 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 29 Nov 2004 08:53:02 +0100 Received: from qrczak by qrnik.knm.org.pl with local (Exim 3.36 #1) id 1CYgLA-0001q2-00 for caml-list@inria.fr; Mon, 29 Nov 2004 08:52:56 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Why doesn't ocamlopt detect a missing ; after failwith statement? X-Face: OW>RV&gN+&b-aiNY|U)f=S%w+/rK!);f>/W9IXg})]&F>ht.1Up8@04+_!gOp(_/l_-+E^. 2\vI)1=D,%HWiq)r(M/V~dr^5T^KF/[w5YZ4<0Sus3+O>l3uA/&W_21m?.s,Po8{pb0@ References: <1101438486.9291.138.camel@pelican.wigram> <20041126.142525.93385094.garrigue@math.nagoya-u.ac.jp> <20041129.090151.110958815.garrigue@math.nagoya-u.ac.jp> From: "Marcin 'Qrczak' Kowalczyk" Mail-Followup-To: caml-list@inria.fr Date: Mon, 29 Nov 2004 08:52:56 +0100 In-Reply-To: <20041129.090151.110958815.garrigue@math.nagoya-u.ac.jp> (Jacques Garrigue's message of "Mon, 29 Nov 2004 09:01:51 +0900 (JST)") Message-ID: <874qj9852f.fsf@qrnik.zagroda> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: "Marcin 'Qrczak' Kowalczyk" X-Miltered: at concorde with ID 41AAD55F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41AAD55D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocamlopt:01 failwith:01 pointers:01 semantics:01 pointers:01 pointer:01 writes:01 jacques:01 variables:02 types:02 garrigue:03 garrigue:03 usual:04 null:05 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: Jacques Garrigue writes: > My point was just that, looking at the way void is used in C, it > clearly does not have the usual proporties of zero, and among them > the fact no function should be able to return zero, or that all > pointers to void should be NULL. Rules of void in C are special. In particular it makes no sense to draw conclusions about "the number of values of type void" from the semantics of pointers to void. There are no values of type void, no variables of type void, and no function arguments of type void. You can't write void deref(void *p) {return *p;} and this is valid only in C++, not in C: void f(); void g() {return f();} There are no values of type void. A C function either produces a value or not. If it does not, it's written by putting 'void' instead of its return type. A pointer to void holds an address of some value, not an address of a value of type void. Trying to treat 'void' analogously to other types will show inconsistencies and lead to contradictions. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/