Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!masscomp!ftw From: ftw@masscomp.UUCP (Farrell Woods) Newsgroups: comp.lang.c Subject: Re: printf() problem Message-ID: <808@masscomp.UUCP> Date: 2 May 89 20:27:42 GMT References: <163@marvin.moncam.co.uk> <1367@ndmath.UUCP> Reply-To: ftw@quasar.masscomp.UUCP (Farrell Woods) Organization: Concurrent Computer Corporation - Westford, Ma Lines: 26 Approved: news In article <1367@ndmath.UUCP> dierks@ndmath.UUCP (Tim Dierks) writes: > I understand that the _order_ of evaluation is undefined... My question >is if the stack-based method of passing arguments, or the order in which >the arguments are passed, is part of the C definition. The alternative >seems to me to be making all functions that take a variable number of >arguments non-portable. Is this the case? You'd have a hell of a time implementing C on some architectures if the standard constrained argument passing like that. The method, order, etc. are not specified. Some C compilers will even pass the first couple of arguments in registers, then the rest on the stack. Don't depend on the order of evaluation of argument expressions. Don't depend on the order in which they are pushed onto the stack. Don't depend that they will all be on a stack, even on stack based machines. -- Farrell T. Woods Voice: (508) 392-2471 Concurrent Computer Corporation Domain: ftw@masscomp.com 1 Technology Way uucp: {backbones}!masscomp!ftw Westford, MA 01886 OS/2: Half an operating system