From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id CAA53BBAF for ; Sun, 1 Nov 2009 13:16:30 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiEDAAsL7UrUCb2ngWdsb2JhbACbUgEBFiS9ZoQ5BIFi X-IronPort-AV: E=Sophos;i="4.44,662,1249250400"; d="scan'208";a="37341636" Received: from mail.enyo.de ([212.9.189.167]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 01 Nov 2009 13:16:30 +0100 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N4ZMC-00081J-UL; Sun, 01 Nov 2009 13:16:29 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N4ZMC-0002XX-BI; Sun, 01 Nov 2009 13:16:28 +0100 From: Florian Weimer To: Adrien Cc: Caml Mailing List Subject: Re: [Caml-list] Binding C libraries which use variable arguments (stdarg.h) References: <666572260910281507q74cb1c1at157c9e3c86070c69@mail.gmail.com> <4AE8C987.8020100@starynkevitch.net> <666572260910291418p585b0aa9laadc14f6589c9772@mail.gmail.com> <4AEAB347.3060008@inria.fr> <666572260911010131x1b3c778bgc1c87879ca96a62d@mail.gmail.com> <87ljiqmrjy.fsf@mid.deneb.enyo.de> <666572260911010412n3f60bb21pc6e1d3bb70279f58@mail.gmail.com> Date: Sun, 01 Nov 2009 13:16:28 +0100 In-Reply-To: <666572260911010412n3f60bb21pc6e1d3bb70279f58@mail.gmail.com> (Adrien's message of "Sun, 1 Nov 2009 13:12:33 +0100") Message-ID: <87r5sil9sz.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; userland:01 debian's:01 varargs:01 rax:01 wrote:01 caml-list:01 functions:01 conventions:02 binding:02 florian:03 florian:03 passing:05 problem:05 variable:06 accident:93 * Adrien: > On 01/11/2009, Florian Weimer wrote: >> * Adrien: >> >>> It turned out it worked on linux x86_32, linux x86_64, netbsd sparc64 >>> with 32-bit userland, debian's kfreebsd amd64 and ppc32. There's >>> windows which I haven't checked yet though. >> >> x86_64 has different calling conventions for varargs and non-varargs >> functions. If it works for you, it's only by accident (e.g. because >> you aren't passing floating-point arguments). >> > > I tried a few things with "double" at first since I'm on x86_64 and > got no warning and no problem whatsoever. Could you check if libffi sets the %rax register to the number of floating-point arguments? (I've seen this working by mere chance in many cases.)