From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA00089; Fri, 20 Feb 2004 20:44:48 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA32680 for ; Fri, 20 Feb 2004 20:44:47 +0100 (MET) Received: from speakeasy.org (dialup-67.75.199.152.Dial1.Seattle.Level3.net [67.75.199.152]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1KJihae002701 for ; Fri, 20 Feb 2004 20:44:44 +0100 Received: (from shawnw@localhost) by speakeasy.org (8.10.1/8.10.1) id i1KJfhR27849 for caml-list@inria.fr; Fri, 20 Feb 2004 11:41:43 -0800 Date: Fri, 20 Feb 2004 11:41:43 -0800 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] void/unit in C calls Message-ID: <20040220194143.GY27866@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shawnw:01 caml-list:01 2004:99 foo:01 foo:01 runtime:01 val:01 shawnw:01 speakeasy:01 speakeasy:01 bytecode:01 external:03 unit:03 unit:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Feb 20, 2004 at 02:26:05PM -0500, Michael Furr wrote: > > I realize this is somewhat of a pedantic question but, what is the proper > prototype for a C function which has a parameter of type unit? > ie: > external foo : unit -> unit = "foo_c" > > should foo_c be declared > void foo_c(void); > or > value foo_c(value); This one. > > Would it ever cause a problem on any architecture if one used the wrong > form? Yup. I've had problems with the bytecode runtime not liking C functions that don't return anything when they should be returning a Val_unit. -- Shawn Wagner shawnw@speakeasy.org ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners