printf() problem

Paul Canniff 2/1011 paulc at microsoft.UUCP
Thu May 4 05:19:08 AEST 1989


In article <6006 at sunray.UUCP> jimp at cognos.UUCP (Jim Patterson) writes:
>In article <89Apr26.092233edt.18850 at me.utoronto.ca> zougas at hammer.me.UUCP (Athanasios(Tom) Zougas) writes:
>>C puts its function parameters on the stack in "reverse" order, i.e.
>>the last item is on top (this allows variable number of parameters
>>for user defined functions). It would happen in any C.
>
>It doesn't happen in "any" C.  While reverse order is commonly chosen
>by C implementations, 

I have no argument, just a clarification for those who belive that
C and reverse-args are inseperable ...

Rev-args IS usually chosen, because it facilitates variable-argument
functions like printf().  However, it isn't the only way to
do var-args.  And indeed, even knowing the order of the parms
on the stack doesn't give you a guarantee that they will always
be *evaluated* in that order.



More information about the Comp.lang.c mailing list