From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24177 invoked by alias); 4 Dec 2013 18:51:04 -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 24164 invoked by uid 89); 4 Dec 2013 18:51:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_20,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Dec 2013 18:51:02 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB4Ioqvw007125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 4 Dec 2013 13:50:52 -0500 Received: from zebedee.pink (ovpn-113-92.phx2.redhat.com [10.3.113.92]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB4IoonP030597; Wed, 4 Dec 2013 13:50:51 -0500 Message-ID: <529F7989.1050000@redhat.com> Date: Wed, 04 Dec 2013 18:51:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131028 Thunderbird/17.0.10 MIME-Version: 1.0 To: "Hogan, D. (GE Power & Water)" CC: Alan Modra , Jakub Jelinek , "libffi-discuss@sourceware.org" Subject: Re: RFC: variadic closures in x86/x86_64 References: <52931854.6080007@redhat.com> <20131125093715.GU892@tucnak.redhat.com> <5293221D.4010505@redhat.com> <20131126142723.GD9211@bubble.grove.modra.org> <529F1E3E.4010401@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013/txt/msg00235.txt.bz2 On 12/04/2013 06:28 PM, Hogan, D. (GE Power & Water) wrote: > On Wed, Dec 04, 2013 at 00:07:21AM, Andrew Haley wrote: > >> Why do you not define a variadic C function which does this: >> >> void f1(int n, ...) { >> va_list ap; > > In the libffi manual, there's a TODO about variadic closures. That's AFAIK to do with targets that have a different calling convention for variadic calls. > 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. 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. Andrew.