Re: How to get warnings for missing methods in older SDKs
Re: How to get warnings for missing methods in older SDKs
- Subject: Re: How to get warnings for missing methods in older SDKs
- From: Christiaan Hofman <email@hidden>
- Date: Sun, 27 Mar 2011 13:21:15 +0200
On Mar 27, 2011, at 12:57, Ben Staveley-Taylor wrote:
> Agreed -- MACOSX_DEPLOYMENT_TARGET means the minimum version that should be supported. To me that means if I accidentally write code that will not run on that minimum OS because it uses a newer SDK addition, I get a compiler warning at least. Otherwise I have created a product that will not run on MACOSX_DEPLOYMENT_TARGET, which surely is contrary to the purpose of the exercise. And I understand the solutions given by you and other posters in this thread and they're great; I'm just saying that Xcode users should not *need* to jump through these hoops. I think relatively few Xcode users will do it, and mistakes will be made. A good product helps users avoid mistakes, it does not say "RTFM" after it's all gone wrong :-)
>
You've run into the same fallacy about deployment target again, which should be obvious and has been explained on this thread and before. Whether your code *runs* on the deployment target does not depend on whether your code uses newer API or not. It depends on whether newer API will actually *run* on that OS version or not. So simply issuing warnings when you use newer API is not the answer. And how would the compiler check whether it will be used or not? The whole point of using an SDK higher than the deployment target is precisely to be able to use newer API, so actually doing that should not be a problem, and therefore should not automatically generate a warning.
I am not saying that it would not be nice to know whether you've used new API in an unsafe manner, but I see no way how the compiler can know about that, and therefore warn about it. I don't want to have loads of warnings about correct use of API.
Christiaan
>
> On 25 Mar 2011, at 22:42, Chris Suter wrote:
>
>>>
>>> There seems to be widespread confusion about this. It strikes me that setting MACOSX_DEPLOYMENT_TARGET to an old version should do what I describe, but I don't imagine I'll get Apple to agree with me.
>>
>> No, MACOSX_DEPLOYMENT_TARGET means the *minimum* version that should
>> be supported, not the maximum. The maximum defaults to the SDK version
>> unless you specify it otherwise.
>
_______________________________________________
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