From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11209 invoked by alias); 5 Dec 2013 00:47:51 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 11177 invoked by uid 89); 5 Dec 2013 00:47:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.2 X-HELO: exprod5og115.obsmtp.com Received: from Unknown (HELO exprod5og115.obsmtp.com) (64.18.0.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) SMTP; Thu, 05 Dec 2013 00:47:45 +0000 Received: from cinmlip10.e2k.ad.ge.com ([12.71.149.1]) (using TLSv1) by exprod5ob115.postini.com ([64.18.4.12]) with SMTP ID DSNKUp/NKej41KnZ25bIn34bbuKXsEMsVvVn@postini.com; Wed, 04 Dec 2013 16:47:44 PST Received: from unknown (HELO ALPMBHT01.e2k.ad.ge.com) ([3.159.19.194]) by cinmlip10.e2k.ad.ge.com with ESMTP/TLS/AES128-SHA; 04 Dec 2013 19:47:36 -0500 Received: from ALPMBCND01.e2k.ad.ge.com (3.159.19.10) by ALPMBHT01.e2k.ad.ge.com (3.159.19.194) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 4 Dec 2013 19:47:35 -0500 Received: from ALPMBAPA05.e2k.ad.ge.com ([169.254.5.229]) by ALPMBCND01.e2k.ad.ge.com ([169.254.7.72]) with mapi id 14.03.0146.000; Wed, 4 Dec 2013 19:47:35 -0500 From: "Hogan, D. (GE Power & Water)" To: Andrew Haley CC: Alan Modra , Jakub Jelinek , "libffi-discuss@sourceware.org" Subject: RE: RFC: variadic closures in x86/x86_64 Date: Thu, 05 Dec 2013 00:47:00 -0000 Message-ID: References: <52931854.6080007@redhat.com> <20131125093715.GU892@tucnak.redhat.com> <5293221D.4010505@redhat.com> <20131126142723.GD9211@bubble.grove.modra.org> <529F1E3E.4010401@redhat.com> <529F7989.1050000@redhat.com> In-Reply-To: <529F7989.1050000@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2013/txt/msg00236.txt.bz2 On Wed, Dec 04, 2013 at 00:01:51PM, Andrew Haley wrote: > > In the libffi manual, there's a TODO about variadic closures. >=20 > That's AFAIK to do with targets that have a different calling > convention for variadic calls. Ok, this is the source of my confusion then. I thought the manual was saying you wanted libffi to be able to create closures that could iterate through variadic arguments they were called with. > > My interpretation of variadic closures is a closure which can access > > variadic arguments without sending in the number of arguments and > > types at the ffi_prep_cif or ffi_prep_cif_var time. Once you have a > > variadic closure, you should be call it any number of times with any > > number of variadic arguments. >=20 > Forgive me, but that's not an answer. I have provided an example of a > mechanism that JNA could use that would not require us to change > libffi. Couldn't you do this in JNA? It doesn't have to be > application-specific. I'm sure it would work. A similar suggestion is mentioned in the CFFI documentation. It would require a C function for every assumed variadic processing convention. For instance, FMI requires ## which is not a typical printf/logger convention. I didn't go down that path because I thought the manual was asking for patches for a different way. Thanks for the feedback.