Thread View: gnu.g++.bug
2 messages
2 total messages
Started by Keith Nishihara
Fri, 15 Dec 1989 01:05
help(stdarg ...); // DecStation 3100.
Author: 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
Re: help(stdarg ...); // DecStation 3100.
Author: Dirk Grunwald
Date: Fri, 15 Dec 1989 17:34
Date: Fri, 15 Dec 1989 17:34
16 lines
1143 bytes
1143 bytes
grab the file 'MIPS.FILES' via anonymous FTP from foobar.colorado.edu it contains a modified stdarg.h (that should be in libg++-1.36.X, X>0) and a modified gnulib2.c. i moved L_varargs from gnulib.c to gnulib2.c -- you'll need to twiddle your makefile a little to get it compiled (move 'varargs' from the gnulib to gnulib2 target) this implements 'builtin_saveregs' for the mips chip. the modified stdarg uses this to flush the $a0..$a3 registers to memory when using stdarg. there's also an md & tm- file that you might want to use - it corrects a couple of bugs in 1.36
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads