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


Perry Smith a écrit :

With C, you can not really assume anything.

If you are trying to do this for one particular platform, then you can look at the code generated and eventually figure out how to do what you want to do. If you are doing 32 bit and 64 bit on one platform, then you could #ifdef the two cases.

That's probably what I'll do. Or find an other way to implement what is currently done.



But if you truly want portable code, then you need to either use varargs or stdargs. stdargs is part of the C standard I believe. It is pretty easy to use.

I guess varargs or stdargs are useles here, since the goal is to implement a function call with a variable number or arguments, not a function with a variable number of arguments.


Thanks for your answer,

Emmanuel.


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