Re: Xcode-users Digest, Vol 4, Issue 4
Re: Xcode-users Digest, Vol 4, Issue 4
- Subject: Re: Xcode-users Digest, Vol 4, Issue 4
- From: Ken Brooks <email@hidden>
- Date: Thu, 4 Jan 2007 20:10:23 -0500
At 12:07 PM -0800 1/3/07, Richard Schreyer wrote:
>Message: 1
>Date: Tue, 2 Jan 2007 12:15:35 -0800
>From: Richard Schreyer <email@hidden>
>Subject: Re: How to snuff warnings on float/int conversion
>To: Ken Brooks <email@hidden>
>Cc: email@hidden
>Message-ID: <email@hidden>
>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>On Jan 2, 2007, at 11:53 AM, Ken Brooks wrote:
>
>> The following code fragment:
>>
>> struct Pipe {
>> int x, y, z;
>> P3 at; // P3 is a small struct of 3 floats
>> <other fields>
>> };
>>
>>
>> void Pipe::vmove(const V3 &delta) {
>> at += worldmove;
>> x = roundf(at.x);
>> y = roundf(at.y);
>> z = roundf(at.z);
>> }
>>
>> Gets warnings like this on the lines like x = roundf(at.x); :
>>
>> /Users/ken/Programs/comp236/Catchwater/Pipeworks/Catchwater.cpp:
>> 731: warning: converting to 'int' from 'float'
>> I don't want such warnings; I'm perfectly happy with implicit
>> truncation of floats. But I've read up and down the GCC manual's
>> warnings list and can't find where to turn them off. -Wno-
>> conversion doesn't get it, that only deals with function
>> prototypes. Anybody know how to do it?
>>
>> Using gcc 4.0, XCode 2.0.
>
>You can entirely avoid using the implicit conversion by using lroundf
>() instead, which returns an int.
>
>Richard
Thanks for the tip.
As it turns out, a more general answer was simply to upgrade to XCode 2.3 . The annoyance messages went away without further action on my part.
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden