Wrong return type of math.h functions in lldb (ios too maybe)

Originator:lorenzo.togna
Number:rdar://24455662 Date Originated:02-Feb-2016
Status:open Resolved:no
Product:xcode Product Version:7
Classification: Reproducible:yes
 
Summary:
If in the xcode debug console (or lldb console) i type

(lldb) p (float)fabsf(-5.0f)
(float) $22 = 0
(lldb) p (double)fabsf(-5.0f)
(double) $23 = 5

the first result casting to float (without casting the p command can't recognize the fabsf return type) is wrong no matter of the parameter.

But in the library headers the return type of fabs is clearly a float.  Also tried with other similar functions (maxsf) and got same issue.

ios9.2: math.h
extern float fabsf(float);
extern double fabs(double);
extern long double fabsl(long double);

Steps to Reproduce:
in xcode lldb console type 
    p (float)fabsf(-5.0f)


but if one types
    p (double)fabsf(-5.0f)
then result is  "(double) $23 = 5"

same for other analog functions

Expected Results:
result for the first function should be result will be "(float) $22 = 5"

Actual Results:
result of actual execution is "(float) $22 = 0"

Version:
Version 7.2 (7C68)

Notes:


Configuration:
It always occour in xcode 7.2 (7c68) in osx 10.10.5, but many others have tried in various other configuration and same issue happened

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!