From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4671387d64020ad3,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-01-22 00:18:17 PST Newsgroups: comp.sys.dec Path: sparky!uunet!haven.umd.edu!wam.umd.edu!herbert From: herbert@wam.umd.edu (David Mark Herbert) Subject: C compiler Message-ID: <1992Jan22.074122.1541@wam.umd.edu> Originator: herbert@wam.umd.edu Sender: usenet@wam.umd.edu (USENET News system) Nntp-Posting-Host: wam.umd.edu Organization: University of Maryland, College Park Date: Wed, 22 Jan 1992 07:41:22 GMT I have a problem using the varargs on the Decstation 5000. It seems to zero out the last and sometimes the first arguments. #include "stdio.h" #include "varargs.h" long test1(y, cnt, va_alist) double y; long cnt; va_dcl { long temp, sum=0.0; va_list arg_marker; printf ("y=%lf %ld\n", y, cnt); va_start(arg_marker); while (cnt--) { temp = va_arg(arg_marker, long); printf ("temp %ld\n", temp); sum += temp; } return (sum); } main () { printf ("Hello world\n"); printf ("The answer is %ld\n", test1((double)2.3, 3L, 2L, 3L, 4L)); } ^^^ ^^ So you can see an example of the problem I have, I have recreated this test code from memory. I marked the arguments that do not seem to be passed correctly. Has anyone else had this problem, and if so how can you fix it? Dave. -- ___________________________________________________ David M. Herbert, University of Merryland herbert@wam.umd.edu