From: herbert@wam.umd.edu (David Mark Herbert)
Subject: C compiler
Date: Wed, 22 Jan 1992 07:41:22 GMT [thread overview]
Message-ID: <1992Jan22.074122.1541@wam.umd.edu> (raw)
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
next reply other threads:[~1992-01-22 7:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-01-22 7:41 David Mark Herbert [this message]
1992-01-22 19:02 ` C compiler Michael Meissner
-- strict thread matches above, loose matches on Subject: below --
1994-08-19 18:33 c compiler mike emmel
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox