Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!microsoft!paulc From: paulc@microsoft.UUCP (Paul Canniff 2/1011) Newsgroups: comp.lang.c Subject: Re: printf() problem Keywords: C printf varargs Message-ID: <5645@microsoft.UUCP> Date: 3 May 89 19:19:08 GMT References: <11657@hodge.UUCP> <89Apr26.092233edt.18850@me.utoronto.ca> <6006@sunray.UUCP> Reply-To: paulc@microsoft.UUCP (Paul Canniff 2/1011) Organization: Microsoft Corp., Redmond WA Lines: 17 In article <6006@sunray.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: >In article <89Apr26.092233edt.18850@me.utoronto.ca> zougas@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.