From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10933 invoked by alias); 8 Oct 2013 17:36:15 -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 10923 invoked by uid 89); 8 Oct 2013 17:36:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Oct 2013 17:36:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r98HaCuD029797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Oct 2013 13:36:12 -0400 Received: from zebedee.pink (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r98HaAIj015170; Tue, 8 Oct 2013 13:36:11 -0400 Message-ID: <5254428A.9080204@redhat.com> Date: Tue, 08 Oct 2013 17:36:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130912 Thunderbird/17.0.9 MIME-Version: 1.0 To: Anthony Green CC: Igor Bogomazov , "libffi-discuss@sourceware.org" Subject: Re: return value buffer malloc()'ed vs alloca()'ed References: <20131008101354.43baeeeb@ygrex-mac> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013/txt/msg00175.txt.bz2 On 10/08/2013 06:30 PM, Anthony Green wrote: > The result > buffer needs to be the largest native integral type on your system. > Use a 64 bit long for rc instead of mallocing the exact return type > size. You can pass it into ffi_call as &rc and simply cast it to an > int at the end. I just checked the docs and it's definitely not > clear Hmmmmm. It's not so much unclear as completely wrong. Andrew.