Xref: utzoo comp.unix.wizards:16635 comp.lang.c:19148 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!skat.usc.edu!blarson From: blarson@skat.usc.edu (Bob Larson) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: Needed: A (Portable) way of setting up the arg stack Keywords: 1/varargs, callg Message-ID: <17606@usc.edu> Date: 4 Jun 89 17:43:33 GMT References: <708@mitisft.Convergent.COM> <32208@apple.Apple.COM> <10354@smoke.BRL.MIL> <11830@bloom-beacon.MIT.EDU> Sender: news@usc.edu Reply-To: blarson@skat.usc.edu (Bob Larson) Followup-To: comp.unix.wizards Organization: USC AIS, Los Angeles Lines: 27 In article <11830@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >va_call can be implemented in one line of assembly language on >the VAX; it typically requires ten or twenty lines on other >machines, to copy the arguments from the vector to the real stack >(or wherever arguments are really passed). I have implementations >for the PDP11, NS32000, 68000, and 80x86. (This is a machine >specific problem, not an operating system specific problem.) ??? Then how come my os9/68k compiler for the 68020 uses a different calling convention than the sun 3 compiler? This problem is most definitly dependant on the calling convention your compiler happens to be using at the moment, which can vary with cpu, operating system, and even compiler options. > A >routine such as va_call MUST be written in assembly language; it >is one of the handful of functions I know of that cannot possibly >be written in C. This almost sounds like a chalange to find a machine where it can be done in non-portable C. I'm sure there is one out there somewhere. -- Bob Larson Arpa: blarson@skat.usc.edu Uucp: {uunet,cit-vax}!usc!skat!blarson Prime mailing list: info-prime-request%ais1@ecla.usc.edu usc!ais1!info-prime-request