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 SAA07670; Tue, 5 Aug 2003 18:40:32 +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 SAA01934 for ; Tue, 5 Aug 2003 18:40:31 +0200 (MET DST) Received: from cymfony.com (host-64-179-106-226.ind.choiceone.net [64.179.106.226]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h75GeUf16873 for ; Tue, 5 Aug 2003 18:40:30 +0200 (MET DST) Received: from lars (vpn2.cymfony.com [64.179.106.232]) by cymfony.com (8.9.3/8.9.1) with SMTP id MAA31682 for ; Tue, 5 Aug 2003 12:38:15 -0400 Message-ID: <000701c35b71$a29daba0$500010ac@cymfony.com> From: "Lars Nilsson" To: "Caml List" Subject: [Caml-list] ocamlopt with external function taking more than 5 params Date: Tue, 5 Aug 2003 12:50:11 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ocamlopt:01 params:01 bug:01 gcc:01 3.06:01 quantum:99 camlprim:01 camlparam:01 printf:01 camlreturn:01 argv:01 argc:01 ocaml:01 bytecode:01 int:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all, 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). For some reason it does not appear that the native code version is being called properly. If anyone can shed any light on this I would be very grateful... The resulting output for the ocamlopt compiled program is Pointer = 0x3, N = 5 This is of course not exactly what I would expect, since I would really like to see a valid array of values containing integers. I am attempting this under RH7.2 Linux, gcc 2.95.3, using both Ocaml 3.06 and the current CVS version, with the same result. Thanks in advance for any insights, Lars Nilsson Quantum Chamaeleon http://www.quantumchamaeleon.com [tester.ml] external tester : int -> int -> int -> int -> int -> int -> int -> int -> unit = "tester_bytecode" "tester_native" let _ = tester 1 2 3 4 5 6 7 8 [c-tester.c] CAMLprim void tester_bytecode(value a, value b, value c, value d, value e, value f, value g, value h) { CAMLparam5(a, b, c, d, e); CAMLxparam3(f, g, h); printf("Doing nothing\n"); CAMLreturn0; } CAMLprim void tester_native(value *argv, int argc) { CAMLparamN(argv, argc); printf("Pointer = %p, N = %d\n", argv, argc); CAMLreturn0; } ------------------- 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