Mail Archives: djgpp/1992/05/27/15:39:44
The following program produces erroneous output in djgpp
#include <stdio.h>
main()
{
unsigned long int ul;
double d;
ul = 4200000000;
d = ul;
printf("%f %lu\n",d,ul);
}
Output is
-94967296.0000000 4200000000
The problem is that gcc is generating a floating point
instruction that gas 1.38 doesnt recognize. (The same bug was found
and fixed by H. J. Lu in the linux compiler). You probably know
about this D.J. (and it should be fixed in gcc2.2 ), however the
long long extension is fubar, and floating point should be eyed
with suspicion.
thanks,
Deinst.
P.S. Sorry about sending my last message to djgpp-request, it was
an accident (honest).
- Raw text -