• 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: strange compiler warnings - can't get rid of them?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange compiler warnings - can't get rid of them?


  • Subject: Re: strange compiler warnings - can't get rid of them?
  • From: Greg Guerin <email@hidden>
  • Date: Tue, 27 Nov 2007 11:28:32 -0700

Jens Miltner wrote:

>Nope, as I mentioned in my OP, explicitely casting to float doesn't
>help either...

Because the warning is designed that way.

Did you read the fine man page for gcc?

The description of -Wconversion is quite clear.  It says a warning will be
issued when "a prototype causes a conversion that is different from what
would happen to the same argument in the absence of a prototype."

In the absence of a prototype, args are doubles, so of course casting to
float still produces the warning.  Because in the absence of a prototype, a
cast-to-float will still be converted to double before being passed as an
arg.

I think the warning you enabled isn't the warning you want.  You may want
the -Wtraditional warning, which does have lesser but similar warnings to
-Wconversion.  You may also want to peruse the man page for further warning
options.

In any case, I think you're getting exactly what you asked for, even if
what you asked for isn't exactly what you wanted.

  -- GG


 _______________________________________________
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: strange compiler warnings - can't get rid of them?
      • From: Jeff Johnson <email@hidden>
    • Re: strange compiler warnings - can't get rid of them?
      • From: Jens Miltner <email@hidden>
  • Prev by Date: Re: strange compiler warnings - can't get rid of them?
  • Next by Date: Re: strange compiler warnings - can't get rid of them?
  • Previous by thread: Re: strange compiler warnings - can't get rid of them?
  • Next by thread: Re: strange compiler warnings - can't get rid of them?
  • Index(es):
    • Date
    • Thread