• 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: pragma nowarn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pragma nowarn


  • Subject: Re: pragma nowarn
  • From: "Alexander v. Below" <email@hidden>
  • Date: Wed, 12 Dec 2007 14:03:46 +0100


On 12.12.2007, at 13:47, Alastair Houghton wrote:

I have yet to see a situation where there is genuinely a reason for not changing the code to fix a warning, assuming that you don't enable any of the sillier warning flags.

Especially when you want to dynamically call methods from different SDKs, getting rid of the warnings can be a challenge. Example:

Take this code, which is compiled against the 10.2 SDK (but the issue is the same for any cross-SDK development):

if (floor(NSAppKitVersionNumber) > 663) // NSAppKitVersionNumber10_2
[center postNotificationName:myNotification object:nil userInfo:info options:(1 << 1)];
else
[center postNotificationName:myNotification object:nil userInfo:info];

This will produce the following warning:

warning: `NSDistributedNotificationCenter' may not respond to `-postNotificationName:object:userInfo:options:'
warning: cannot find method `-postNotificationName:object:userInfo:options:'; return type `id' assumed

For someone who likes his code warning free, I have found no way of getting rid of this warning. And I DO NOT want to turn off the "cannot find method" warning

Alex

 _______________________________________________
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: pragma nowarn
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: pragma nowarn
      • From: Alastair Houghton <email@hidden>
    • Re: pragma nowarn
      • From: William Bates <email@hidden>
References: 
 >pragma nowarn (From: William Bates <email@hidden>)
 >Re: pragma nowarn (From: Alastair Houghton <email@hidden>)
 >Re: pragma nowarn (From: William Bates <email@hidden>)
 >Re: pragma nowarn (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: How does the compiler figure out conflicting return types, and why no warnings?
  • Next by Date: Re: pragma nowarn
  • Previous by thread: Re: pragma nowarn
  • Next by thread: Re: pragma nowarn
  • Index(es):
    • Date
    • Thread