This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Question about function call stack


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.

	Emmanuel.

Attachment: signature.asc
Description: Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]