Isaac Marino Bavaresco wrote: > With the callee cleaning the stack it would be impossible (or at least > very difficult) to have functions with variable-length argument lists > like printf. > > For some architectures it adds more complexity also, because first the > return address need to be removed from the stack and saved, then the > stack pointer must be incremented (decremented for some) and the return > address finally used to return. On the PIC 18 there are separate data and return address stacks, so this is not a issue. I didn't realize that all C functions are allowed to be called with different number of arguments. Is this really the case? To me this seems like a really brain dead choice considering that fixed number of arguments is common and knowing that at compile time allows for some obvious optimizations. I can see the point to variable numbers of arguments, but I also don't see a drawback to making you say this is a possibility in the routine declaration. The compiler can then catch accidental wrong number of arguments supplied in the majority of cases where you intend to always call with the fixed list of arguments. Is C really defined to not allow for this? ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist