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 OAA25579; Thu, 7 Aug 2003 14:47:54 +0200 (MET DST) 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 OAA28782 for ; Thu, 7 Aug 2003 14:47:52 +0200 (MET DST) Received: from inria.fr (macabane.inria.fr [128.93.8.160]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h77Clpf23802; Thu, 7 Aug 2003 14:47:52 +0200 (MET DST) Date: Thu, 7 Aug 2003 14:47:50 +0200 Subject: Re: [Caml-list] ocamlopt with external function taking more than 5 params Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: "Caml List" To: "Lars Nilsson" From: Damien Doligez In-Reply-To: <000701c35b71$a29daba0$500010ac@cymfony.com> Message-Id: <5A714C82-C8D5-11D7-887E-0030657B6F2E@inria.fr> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 caml-list:01 ocamlopt:01 params:01 bug:01 camlprim:01 argv:01 argc:01 bytecode:01 int:01 doligez:01 native-code:02 native:02 o'caml:02 external:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday, Aug 5, 2003, at 18:50 Europe/Paris, Lars Nilsson wrote: > I am wondering if I am doing something wrong, or if I am experiencing > a bug. > I am trying to implement a function in C that takes more than 5 > parameters > (8 in my real code). [...] > The resulting output for the ocamlopt compiled program is > > Pointer = 0x3, N = 5 Note that 0x3 is the representation of 1 as an O'Caml value, and 5 is the representation of 2. > CAMLprim void tester_bytecode(value a, value b, value c, value d, > value e, value f, value g, value h) > CAMLprim void tester_native(value *argv, int argc) You have them reversed. The native-code version should take 8 arguments, and the byte-code version should take argv and argc. -- Damien ------------------- 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