This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem while building arm vfp softfloat gcc


> Dan, 
> 
> gcc-3.3.2 with glibc-2.3.2 seem to have problems with printf and
> floating point anyway. Look at this test case: 
> 
> ----------8<----------
> #include <stdio.h>
> 
> int main (void)
> {
> 	float f = 1.0;
> 	double d = 1.0;
> 	long double ld = 1.0;
> 	
> 	printf ("Without cast:\n");
> 	printf ("float:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", f, f, f);
> 	printf ("double:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", d, d, d);
> 	printf ("long double:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", ld, ld, ld);
> 	
> 	printf ("With cast:\n");
> 	printf ("float:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", (float) f, (double) f, (long double) f);
> 	printf ("double:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", (float) d, (double) d, (long double) d);
> 	printf ("long double:\n");
> 	printf ("f : %f\nlf: %lf\nLf: %Lf\n", (float) ld, (double) ld, (long double) ld);
> 	return 0;
> }

FYI, I've run the above testcase on arm-netbsdelf (which uses soft-vfp by 
default) and it produces 1.00000 for every value (as it should).  So this 
must either be a problem with the float-conversion functions or with 
glibc.  My suspicion would fall on the latter, especially since long 
double format should be the same as double.

R.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]