Will it execute everywhere ?

Henry Spencer henry at zoo.toronto.edu
Sat Jul 28 19:08:12 AEST 1990


In article <831 at gtenmc.UUCP> csp at gtenmc.UUCP (Chardutta S. Palkar) writes:
>	This is to avoid the usage of varargs. The only restriction
>	is to pass number of arguments as the first parameter.
>	Will this piece of code execute irrespective of the order
>	in which the parameters are pushed on the stack ie. right
>	to left or left to right? ...

No.  You can forget about finding a portable way to avoid using vararg.h
(or its improved ANSI incarnation, stdarg.h); there is *none*.  None.  NONE.
***NONE***.  There are a dozen different tricks people are fond of using,
and they all fail on an increasing number of machines.  (What makes you
think the parameters are pushed on the stack in any simple order, or
indeed that they are pushed onto a stack at all?)
-- 
NFS:  all the nice semantics of MSDOS, | Henry Spencer at U of Toronto Zoology
and its performance and security too.  |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list