Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!shelby!csli!keith From: keith@csli.Stanford.EDU (Keith Nishihara) Newsgroups: gnu.g++.bug Subject: help(stdarg ...); // DecStation 3100. Keywords: stdargs, ds3100 Message-ID: <11451@csli.Stanford.EDU> Date: 15 Dec 89 01:05:29 GMT Sender: keith@csli.Stanford.EDU (Keith Nishihara) Reply-To: Neil Hunt Organization: Center for the Study of Language and Information, Stanford U. Lines: 36 Has anyone made the stdargs stuff work in g++ 1.36.2, on a decstation 3100? My attempts are simply not putting the arguments on the stack, so bad data is being pulled off in the called function. I have tried using g++-include/stdargs.h, and various hacks of other attempts at stdarg.h (from cfront, the native compiler, etc.) --------------------------------------------------------------------------- #include #include void print(const char *fmt ...) { va_list ap; va_start(ap, fmt); fprintf(stderr, "print test: "); vfprintf(stderr, fmt, ap); va_end(ap); } main() { print("This is a test of three numbers %d 0x%x %f\n", 10, 0x123, 0.123); } --------------------------------------------------------------------------- I get: print test: This is a test of three numbers 0 0x10001330 0.123000 I wanted: print test: This is a test of three numbers 0 0x123 0.123000. Neil/. Neil%teleos.com@ai.sri.com ...decwrl!argosy!teleos!neil