On 18/02/2010 10:11, Naveen H. S wrote:

> Issue
> -----
> Float variables are prefixed by some garbage value in printf function. 
> However, the values are generated correctly when seen through GDB.
> Ex:- If the expected result is 0.456
> RUN OUTPUT - 0.000000456 (INCORRECT)
> GDB OUTPUT - 0.456 (CORRECT)
> 
> The above issue is observed only with the float variables less than one.
> i.e. error result if  (-1 < value < 1)
> The values are displayed correctly if the value does not fall in above 
> range. 
> Ex:- If the expected result is 1.456
> RUN OUTPUT - 1.456 (CORRECT)
> GDB OUTPUT - 1.456 (CORRECT)
> 
> The above mentioned issue was not observed with gcc-3.4.4. However, on
> porting to gcc-4.4.1; we are observing this issue.

  It's hard to imagine that this could be some kind of bug in the compiler's
argument passing that was causing this effect, much more likely that there's a
bug in your libc printf code, possibly some undefined behaviour that has only
become a problem because of improvements to the optimisers in series 4; you'll
probably have to debug your printf routine to see where it's going wrong.

    cheers,
      DaveK

Reply via email to