Article View: gnu.g++.bug
Article #2092help(stdarg ...); // DecStation 3100.
From: Keith Nishihara
Date: Fri, 15 Dec 1989 01:05
Date: Fri, 15 Dec 1989 01:05
36 lines
1523 bytes
1523 bytes
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 <stdio.h>
#include <stdarg.h>
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
Technical Details
Message-ID:
<11451@csli.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!shelby!csli!keithShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 <Neil%teleos.com@ai.sri.com> Organization: Center for the Study of Language and Information, Stanford U. Lines: 36