• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to snuff warnings on float/int conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to snuff warnings on float/int conversion


  • Subject: How to snuff warnings on float/int conversion
  • From: Ken Brooks <email@hidden>
  • Date: Tue, 2 Jan 2007 14:53:38 -0500

Title: How to snuff warnings on float/int conversion
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.

Ken Brooks     
 _______________________________________________
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

  • Follow-Ups:
    • Re: How to snuff warnings on float/int conversion
      • From: Richard Schreyer <email@hidden>
  • Prev by Date: Re: ld -syslibroot reliability
  • Next by Date: Re: How to snuff warnings on float/int conversion
  • Previous by thread: Re: adding target dependencies to an Xcode project using AppleScript
  • Next by thread: Re: How to snuff warnings on float/int conversion
  • Index(es):
    • Date
    • Thread