• 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: Alastair Houghton <email@hidden>
  • Date: Wed, 12 Dec 2007 15:05:01 +0000

On 12 Dec 2007, at 13:49, Philip Aker wrote:

On 2007-12-12, at 04:47:30, 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.

10.4 was a good place to remark deprecated calls and replace them. I had a warning about GetFNum() throughout 10.4 because OSADisplay() required an obsolete format and a replacement call was not available until 10.5. I did not want to have a warning about code that worked for years since I have 'warnings are errors' turned on. I actually didn't know that pragma was available and so turned off warnings for the file in question. Which was not really what I wanted.

#pragma nowarn isn't available. There are some near-equivalents though they aren't guaranteed to work how you'd like them to in all cases (because of the optimiser).


Is there something silly about 'warnings are errors' for you? I find it saves me a lot of grief. For instance purging FSSpecs in 10.4 at my leisure was one of the things that made this code hunk transition to Leopard an easy task.

I don't use "Warnings are errors" myself, but since I always make a point of fixing warnings the end effect is the same.


I agree that there are a limited number of cases (primarily involving deprecated APIs) where you might want to do something. I think I'm right in saying though that if you set the "Mac OS X Deployment Target" to a version where the API wasn't deprecated, you don't get the deprecation warnings. You can set that on a per-file basis, so that's probably the solution I'd have chosen for the file you're talking about.

Kind regards,

Alastair.

--
http://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
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>)
 >Re: pragma nowarn (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Xcode 3 SCM (Subversion)?
  • Next by Date: Re: Encoding of "long string"
  • Previous by thread: Re: pragma nowarn
  • Next by thread: Linking problem
  • Index(es):
    • Date
    • Thread