Question about function call stack

Emmanuel Pacaud
Sat Jan 21 10:55:00 GMT 2006

Le mercredi 18 janvier 2006 à 17:28 -0500, Meissner, Michael a écrit :
> No, you can never make that assumption.  Every different port of GCC
> uses a different calling sequence.  Sometimes switches will change the
> calling sequence.  Some ABI's will pass nothing in registers (i386
> classic), some will pass the first few arguments in certain registers
> depending on the type of the arguments, some will pass some things on
> the stack and other things in registers.
> The standard way to write your program is to convert it to use stdarg.h,
> and use va_arg to get at the arguments.  Be sure that the variable
> argument function is properly declared, since some ports have different
> calling sequences for functions with a fixed number of arguments and
> with a variable number.

Thanks you all for the answers.

Since there was no hope to make current code portable, I've changed it
to something more conventional.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message num?riquement sign?e
URL: <>

More information about the Gcc-help mailing list