pilgrim2 wrote:
> 
> Hi, 
> 
>   I was wondering how come the call to "call cos(.2)" returns the wrong
> answer in:
> 
> #include <math.h>
> double    (*fcn)(double);
> main() 
> {
>   double t;
>   fcn = cos;
>   t=cos(.2);
>   t=cos(-.2);
> }
> 
> (gdb) call cos(.2)
> $16 = 104
> (gdb) call fcn(.2)
> $17 = 0.98006657784124163
> 
> Thanks,
> 
> Linh
> 
I wonder too. Why just debug symbols has no info about types of used
functions... Of course, naive casting has no luck - result rather in other
registry (somewhere in r0-r7 and not in ax,...)
-- 
View this message in context: 
http://old.nabble.com/Why-%22call-cos%28.2%29%22-returns-garbage--tp26909516p28659353.html
Sent from the Gnu - gdb - General mailing list archive at Nabble.com.


Reply via email to