Thanks for the reply, I saved the content of the links to study. But,=20 I'm looking for more a overall reference, and don't mind buying hard=20 copy. :) On 8/12/2010 1:20 PM, RussellMc wrote: > This MAY be of some use: > > http://www.greenend.org.uk/rjk/2003/03/inline.html > > & > http://www.gnu.org/software/hello/manual/autoconf/Function-Portability.ht= ml > > > > On 13 August 2010 00:18, Carl Denk wrote: > > =20 >> Can someone suggest a book or online reference I could print out that ge= ts >> into the details of C99 (that's the version that microchip is based on >> ??) that this thread >> and things like "ifndef" are covered. Microchip seems to leave out some >> standard stuff, or I just haven't found where it's hiding. >> >> On 8/11/2010 11:13 PM, Daniel Serpell wrote: >> =20 >>> Hi, >>> >>> On Wed, Aug 11, 2010 at 5:54 PM, peter green >>> =20 >> wrote: >> =20 >>> =20 >>>> Wouter van Ooijen wrote: >>>> >>>> =20 >>>>> > Afaict C varargs require the caller to do the removal >>>>> >>>>> >>>>> =20 >>>>>> because only the caller knows for sure how many parameters have been >>>>>> passed and due to the retarted way C handles prototypes you can't ha= ve >>>>>> =20 >> a >> =20 >>>>>> different interface for varargs and non-varargs functions. >>>>>> >>>>>> >>>>>> =20 >>>>> Maybe in super-ancient C, but with function prototypes... >>>>> >>>>> >>>>> =20 >>>> But when the compiler builds the function it doesn't know whether the >>>> caller will be using function prototypes or not. >>>> >>>> =20 >>> The C99 standard explicitly requires that you have the prototype in the >>> varargs case, see 6.5.2.2 paragraph 6: >>> >>> If the expression that denotes the called function has a type that d= oes >>> not include a prototype, the integer promotions are performed on eac= h >>> argument, and arguments that have type float are promoted to double. >>> These are called the default argument promotions. If the number of >>> arguments does not agree with the number of parameters, the behavior= is >>> undefined. If the function is defined with a type that includes a >>> prototype, and either the prototype ends with an ellipsis (, ...) or >>> =20 >> the >> =20 >>> types of the arguments after promotion are not compatible with the >>> =20 >> types >> =20 >>> of the parameters, the behavior is undefined. >>> >>> So, if you try to call a vararg function without providing the prototyp= e, >>> the result is undefined because you cannot define a vararg function >>> without using a prototype, see 6.9.1 p8. >>> >>> Daniel. >>> >>> >>> =20 >> -- >> http://www.piclist.com PIC/SX FAQ& list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >> >> =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .