[gnu.g++.bug] Help

keith@csli.Stanford.EDU (Keith Nishihara) (12/15/89)

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

grunwald@foobar.colorado.edu (Dirk Grunwald) (12/16/89)

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

rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) (01/19/90)

Anybody know what might cause ld (through g++) to fail, error code 1, with
no error messages, and not create an executable?  I've got everything to
compile (1.36.1; I switched back) but it won't link . . .

If I take off the -lg++, it fails with `unresolved _xyzzy' or some such,
which makes sense sort of . . .

-tom