Re: Math.h functions with CGFloat
Re: Math.h functions with CGFloat
- Subject: Re: Math.h functions with CGFloat
- From: Kyle Sluder <email@hidden>
- Date: Tue, 10 Aug 2010 08:35:43 -0700
On Tue, Aug 10, 2010 at 8:28 AM, Graham Cox <email@hidden> wrote:
> If your code is working with CGFloat, then the warning isn't very helpful, because by using CGFloat you've elected to use 32-bit precision. If you want 'double', use 'double'. The warning could be useful on 64-bit compiles to indicate the inadvertent use of 'float' where you meant 'double' or 'CGFloat', but if you're only using CGFloat then that won't happen.
Turning off -Wshorten-64-to-32 is not a preferable option. Remember
that this also warns about long -> int conversion on LP64.
The correct thing to do is leave the warning enabled and #include <tgmath.h>.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden