• 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
Re: How to disable 'warning: converting to 'int' from 'float'' warning?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to disable 'warning: converting to 'int' from 'float'' warning?


  • Subject: Re: How to disable 'warning: converting to 'int' from 'float'' warning?
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 7 Oct 2005 17:41:38 +0100

On 7 Oct 2005, at 17:01, Sean McBride wrote:

On 2005-10-06 23:52, Alastair Houghton said:

How does one disable the warning "warning: converting to 'int' from
'float'".

I know I could cast, but there are too many. :(

Just cast. If it's your intention to convert a float to an int, you should have a cast there to show that; otherwise the code isn't clear.


I agree. But adding thousands of casts really doesn't appeal to me. It's an old codebase.

(Having not seen your code, of course, this is all very general advice.
Maybe it doesn't apply to you for some reason, or maybe you really have
your heart set on turning off this warning rather than changing the
code.)

So is it really impossible to turn off this warning? gcc has so many
options! But none for this one? :( I don't want to have to disable all
warnings.

I'm assuming that this is C++ code (or ObjC++ code), since I can't see where this warning would come from otherwise, in which case a quick review of the GCC code reveals that there is indeed no way to disable this warning (short of changing the file gcc/cp/call.c, that is).

It should be relatively easy to add an option to GCC to control this
warning if you *really* need to disable it.  Otherwise you could adopt
the approach I saw a while back, which was to always run the compiler
through a Perl script that filtered out unwanted warnings.  (I can't
say I'm a huge fan of that, but it might be a good option for you, which
is why I mention it).

Kind regards,

Alastair.

--
http://www.alastairs-place.net


_______________________________________________ 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 disable 'warning: converting to 'int' from 'float'' warning?
      • From: "Sean McBride" <email@hidden>
    • Re: How to disable 'warning: converting to 'int' from 'float'' warning?
      • From: Andy Lee <email@hidden>
References: 
 >How to disable 'warning: converting to 'int' from 'float'' warning? (From: "Sean McBride" <email@hidden>)
 >Re: How to disable 'warning: converting to 'int' from 'float'' warning? (From: Alastair Houghton <email@hidden>)
 >Re: How to disable 'warning: converting to 'int' from 'float'' warning? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: avoid spaces in build configuration name
  • Next by Date: GDB: Does "catch vfork" work?
  • Previous by thread: Re: How to disable 'warning: converting to 'int' from 'float'' warning?
  • Next by thread: Re: How to disable 'warning: converting to 'int' from 'float'' warning?
  • Index(es):
    • Date
    • Thread