From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 352DDBBAF for ; Tue, 5 Jan 2010 14:04:57 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.47,505,1257116400"; d="scan'208";a="44213316" Received: from macabane.dapa.lip6.fr (HELO [192.168.1.100]) ([132.227.203.15]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 05 Jan 2010 14:04:57 +0100 Message-Id: <3EE07409-9559-4B91-BA3E-8787D1378275@inria.fr> From: Damien Doligez To: caml-list List In-Reply-To: <4B3BE288.4030701@citycable.ch> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] problem creating .cma library Date: Tue, 5 Jan 2010 14:04:56 +0100 References: <56670.41.177.16.252.1262195331.squirrel@41.177.16.252> <4B3BE288.4030701@citycable.ch> X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; damien:01 damien:01 guillaume:01 stdio:01 mlvalues:01 mylib:01 mylib:01 camlprim:01 stub:01 camlparam:01 val:01 val:01 camlparam:01 camlreturn:01 2009:98 On 2009-12-31, at 00:30, Guillaume Yziquel wrote: >> #include >> #include >> #include "../mylib/mylib.h" >> CAMLprim value >> my_print_stub(value v) { > > CAMLparam1(v); /* is missing here, for garbage > collection purposes. */ > >> char* str = (char*)String_val( v ); > > /* You do not need the right-hand side (char*) casting. */ > >> my_print( str ); >> return Val_unit; >> } If you use CAMLparam1, you must use CAMLreturn instead of return. -- Damien