C calling conventions: how to pass a struct parameter?
Cezar Harabula
cezar.harabula@open-plug.com
Fri Apr 23 07:38:00 GMT 2004
Thank you for your answers. Unfortunately, I was not clear enough. I
want to know what happens in the registers and in the stack when a
procedure like
void PrintFoo(struct Foo foo)
is called. There is no universal C calling convention set for x86, so I
am interested in how GCC usually does.
What about a struct return value:
struct bar Function() ?
Thanks.
Cezar
Eljay Love-Jensen wrote:
> Hi Cezar,
>
> (Hey, "Cezar", cool name.)
>
> This should work:
>
> struct Foo { int a,b,c; };
>
> void PrintFoo(struct Foo foo)
> {
> printf("Foo:%d,%d,%d\n", foo.a, foo.b, foo.c);
> }
>
> That's a pass-by-value.
>
> Here's pass-by-pointer:
>
More information about the Gcc-help
mailing list