Subject: Re: printf bug ?
To: Michael Graff <explorer@flame.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 02/18/1996 14:54:54
Michael Graff  (<explorer@flame.org>) writes:

[Manuel Bouyer wrote:]

>>Did anyone else noticed this ? This breaks df. 
>>I use the gcc 2.7.2 from the source tree. Perhaps i should keep the
>>2.7.1 from 1.1 binaries ?


>gcc 2.7.1 wasn't in 1.1, was it?  Wasn't it 2.4.5?

gcc 2.7.1 was what was in the _pmax_ 1.1 binary release.
When 2.7.2 was integrated into NetBSD< I looked through the gcc 2.7.2
Changelogs and didn't notice anything substantially different.

>
>Anyhow, I get this from last night's sources:
>
>  54.039391 4
>
>``works for me'' :)
>

Yes, but which version of the compiler did you use to compile
the libc and the example program?  That's the point at issue,
I think.  I've also seen this  reported before.


Mine says:
Reno> cc -v -o bug bug.c
./gcc version 2.7.2
b /usr/libexec/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ANSI_COMPAT -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__NetBSD__ -Dmips -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ -Dunix -D_R3000 -D__ANSI_COMPAT -D__MIPSEL__ -D__R3000__ -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__NetBSD__ -D__mips__ -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ -D__unix__ -D_R3000 -D__MIPSEL -D__R3000 -D__SYSTYPE_BSD -D__mips -D__unix -Asystem(unix) -Asystem(NetBSD) -Amachine(mips) -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int bug.c /var/tmp/cc002006.i
uGNU CPP version 2.7.2 [AL 1.1, MM 40] NetBSD/pmax
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
g /usr/libexec/cc1 /var/tmp/cc002006.i -quiet -dumpbase bug.c -version -o /var/tmp/cc002006.s
GNU C version 2.7.2 [AL 1.1, MM 40] NetBSD/pmax compiled by GNU C version 2.7.1.
 as -v -o /var/tmp/cc0020061.o /var/tmp/cc002006.s
GNU assembler version 2.6 (mips-dec-netbsd), using BFD version 2.6
 ld -e __start -dc -dp -o bug /usr/lib/crt0.o -L/usr/libexec /var/tmp/cc0020061.o -lgcc -lc -lgcc
Reno> ./bug
  54.039391 4

I wonder if this could be due to the stdargs/varargs headers?  I notice
I'm still using old (1.1?) headers, and *I* can't reproduce
this problem.   A sharfile of the headers from the system I compiled
on is appended.  Manuel, could you try installing those headers in
/usr/include/machine, recompiling libc and your test program, 
and seeing if that works?

thanks

--Jonathan