• 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: Jeff Johnson <email@hidden>
  • Date: Tue, 27 Nov 2007 13:08:57 -0600

On Nov 27, 2007, at 12:28 PM, Greg Guerin wrote:

The description of -Wconversion is quite clear.

I wouldn't go that far. ;-) As the following code demonstrates, the argument in the function call is pretty much irrelevant: you get the exact same warning each time. In essence, it's warning you that you've declared a function with a float argument rather than a double argument. Why don't they just give the warning at the declaration rather than at the function calls? That would make more sense to me.


-Jeff


#import <Foundation/Foundation.h>

void doNothing(float myFloat)
{
}

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	doNothing(1.0); // Warning on -Wconversion
	doNothing(1.0f); // Warning on -Wconversion
	doNothing(1.0l); // Warning on -Wconversion
    [pool release];
    return 0;
}

_______________________________________________
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


References: 
 >Re: strange compiler warnings - can't get rid of them? (From: Greg Guerin <email@hidden>)

  • Prev by Date: Re: HeaderDoc DTD
  • Next by Date: Re: How can I get rid of the "Deployment Folder"
  • Previous by thread: Re: strange compiler warnings - can't get rid of them?
  • Next by thread: Hello, List!
  • Index(es):
    • Date
    • Thread