clang flag to suppress floating-point conversion warnings

Originator:an00na
Number:rdar://16267720 Date Originated:07-Mar-2014 07:06 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.0 beta 1
Classification:Enhancement Reproducible:Always
 
Summary:
For 64 & 32-bit compatible code, all CGFloat values have to be explicitly qualified with (CGFloat) to please the compiler. For example, 0.1 is double so should be the same as CGFloat under 64-bit, but Xcode will complain when compiling 64 & 32-bit universal binary:
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION can be used but it covers many other types of conversion warnings which are actually very useful and should not be suppressed. So a finer-grained flag for suppressing this warning is much needed.

Code: http://cl.ly/3q3w321d4024

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!