From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Meissner To: David.Young@vviuh221.vvi.com Cc: gcc@gcc.gnu.org Subject: Re: gcc and struct passing in function arguments? Date: Wed, 05 Jul 2000 13:09:00 -0000 Message-id: <20000705160903.29063@cse.cygnus.com> References: <10007051926.AA02745@vviuh221.vvi.com> <10007052008.AA02872@vviuh221.vvi.com> X-SW-Source: 2000-07/msg00072.html On Wed, Jul 05, 2000 at 04:08:35PM -0400, David Young wrote: > Hi! > > Does anyone know if... > > gcc can do struct passing in arguments and return of functions? > (not pointer to struct, but struct by value) > Is there a 32 byte limit (or similar) to this? > Is this feature ANSI-C compliant? It depends on the ABI. Different ABI's do different things. For example, powerpc-eabi or powerpc-linux always passes structures by copying the structure to a temporary location on the stack and passing the address of the temporary. For AIX, the first 8 words of integral and structure arguments are passed in registers and the remaining elements are passed on the stack. -- Michael Meissner, Red Hat, Inc. PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA Work: meissner@redhat.com phone: +1 978-486-9304 Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482