Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!wiley!spp2!trwarcadia.uucp!simpson From: simpson@trwarcadia.uucp Newsgroups: comp.unix.wizards Subject: Calling Varargs Twice on a Sun 3 (MC68020) Message-ID: <1698@spp2.UUCP> Date: 21 Mar 89 18:39:24 GMT Sender: news@spp2.UUCP Reply-To: simpson@trwarcadia.uucp () Organization: TRW Arcadia Project Lines: 48 Can anyone tell me the magic incantation to call varargs twice on a Sun 3/60? I don't know the format of the stack and I don't have a Motorola manual. Please don't flame me for non-portability. What I want to do is this (which only gives me the first argument): #include #include b(va_alist) va_dcl { char *s1, *s2; va_list ap; va_start(ap); s1 = va_arg(ap, char *); s2 = va_arg(ap, char *); printf("b(): s1=%s, s2=%s\n", s1, s2); va_end(ap); } /* a() calls b() */ a(va_alist) va_dcl { char *s1, *s2; va_list ap; va_start(ap); s1 = va_arg(ap, char *); s2 = va_arg(ap, char *); printf("a(): s1=%s, s2=%s\n", s1, s2); b(va_alist); va_end(ap); } main() { static char *s1 = "Hello"; static char *s2 = "There"; a(s1, s2); exit(0); } Scott Simpson TRW Space and Defense Sector oberon!trwarcadia!simpson (UUCP) trwarcadia!simpson@oberon.usc.edu (Internet)