This change squelches the warning for a cast from fixed to fixed point
conversions when -Wbad-function-cast is enabled.
Fixes:
cast from function call of type '_Fract' to non-matching type '_Fract'
[-Wbad-function-cast]
Differential D85157
[Sema] Add casting check for fixed to fixed point conversions vabridgers on Aug 3 2020, 1:40 PM. Authored by
Details This change squelches the warning for a cast from fixed to fixed point Fixes: cast from function call of type '_Fract' to non-matching type '_Fract'
Diff Detail
Event Timeline
Comment Actions I updated the commit header with more details since the first submission was obviously too terse. @bjope, I believe the update should address your comments.
Comment Actions remove -DFIXED_POINT from lit test, since it's not needed in this casting
Comment Actions ok, I think it's all sorted out now. Thanks @bevinh for the desk review. Let's start at the beginning again :)
|
Is this really the intention with the patch?
It does match the "summary" above, but isn't the warning well deserved for int->fixed cast.
I also base that question on the you referred to this patch from our bugtracker at Ericsson, which was about conversions from long __fixed to long __fixed. So I kind of expected to find (SrcType->isFixedPointType() && DestType->isFixedPointType()) here (similar to the checks above that avoids warning when SrcType equals the DestType).
The test case I expected (related to our downstream bug report) would look like this: