Re: No warning on float to int assignment?
Re: No warning on float to int assignment?
- Subject: Re: No warning on float to int assignment?
- From: Jason Coco <email@hidden>
- Date: Fri, 24 Oct 2008 14:22:43 -0400
On Oct 24, 2008, at 14:10 , Don Arnel wrote:
I was just looking through some code that I wrote, and noticed I had
changed a float to an int in my header file but I was still
assigning float values to it in the code. The odd thing was that the
compiler was not complaining about it. Which warning is it that I
need to turn on in the compiler settings? I've looked through all
the warning options but can't seem to find it. I'm using Xcode
3.1.1, GCC 4.0.
It's perfectly legal to cast a float to an integer... the integral
portion is always maintained and the remainder is simply truncated. I
can't really think of a reason to warn about this, which is probably
why no such warning exists.
J
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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