[uClibc 0000845]: uClibc Floating Point Bug with all Print Functions

bugs at busybox.net bugs at busybox.net
Sat Oct 7 06:02:59 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=845 
====================================================================== 
Reported By:                james
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   845
Category:                   Architecture Specific
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 unable to reproduce
Fixed in Version:           
====================================================================== 
Date Submitted:             04-21-2006 09:30 PDT
Last Modified:              10-06-2006 23:02 PDT
====================================================================== 
Summary:                    uClibc Floating Point Bug with all Print Functions
Description: 
We have identified a bug with the uClibc library used with an ARM core
processor. Floating point numbers under
http://busybox.net/bugs/view.php?id=43#11.0 with certain formating flags
do not print with printf.  The one I am using is a 6 character width and 2
digit precision on a floating point number.

For example:
ret = printf("%6.2f\n", 15.0);  /* prints " 15.00", ret = 7 */
ret = printf("%6.2f\n", 10.0);  /* prints " 1", ret = 0, should be "
10.00" 
*/
ret = printf("%6.2f\n", 5.0);  /* prints "", ret = 0, should be "  5.00"
*/

This happens with the entire family of printf (sprintf, fprintf, etc)
that uses the vfprintf library calls.

A customer of ours has also identified this problem: We have the same
problem with all powers of 10 (100.0, 1000.0, 10000.0,
....).
====================================================================== 

---------------------------------------------------------------------- 
 vapier - 04-21-06 14:49  
---------------------------------------------------------------------- 
$ cat test.c
#include <stdio.h>
#define it(f) printf("%s ", #f); printf("  ret: %i\n", printf("%6.2f",
f));
int main() {
it(15.0) it(10.0) it(5.0)
}
$ gcc test.c && ./a.out
15.0  15.00  ret: 6
10.0  10.00  ret: 6
5.0   5.00  ret: 6
$ gcc -fno-builtin test.c && ./a.out
15.0  15.00  ret: 6
10.0  10.00  ret: 6
5.0   5.00  ret: 6

works just fine for me on arm/uclibc-0.9.28 ... tested little endian
hardfloat and big endian softfloat with gcc-3.3.4 and gcc-3.4.5 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-21-06 09:30  james          New Issue                                    
04-21-06 09:30  james          Status                   new => assigned     
04-21-06 09:30  james          Assigned To               => uClibc          
04-21-06 14:49  vapier         Note Added: 0001319                          
04-21-06 14:49  vapier         Status                   assigned => resolved
04-21-06 14:49  vapier         Resolution               open => unable to
reproduce
10-06-06 23:02  vapier         Status                   resolved => closed  
======================================================================




More information about the uClibc-cvs mailing list