[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in doprnt.c?



While experimenting with -mshort, I wrote this simple test
program:

#include <stdio.h>
main()
{
printf ("int: %d bytes\n, sizeof (int));
printf ("long: %d bytes\n, sizeof (long));
printf ("long long: %d bytes\n, sizeof (long long));
}

Compiled without -mshort, it yields:

int: 4 bytes
long: 4 bytes
long long: 8 bytes

Compiled with -mshort and linked with -lgnu16:

int: 0 bytes
long: 0 bytes
long long: 0 bytes

Compiled with -mshort, and linked (accidentally, but it worked)
with -lgnu:

int: 2 bytes
long: 4 bytes
long long: 8 bytes


This leads me to believe that the 16 bit version of _doprnt
(which does the work for printf) is broken.  Could someone
verify this and fix it if they get the same thing?

Thanks

Yves