Detect unsupported SDK calls

Number:rdar://11985733 Date Originated:30-Jul-2012
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
Apple's advice for supporting older versions of the SDK is to set the deployment target, but link to the latest SDK. This is very dangerous in practice because if your program makes a call to a function that is not supported in your deployment target, you will get no warning, but it will crash at runtime. Neither the compiler nor the static analyzer will help protect you from this.

Apple's advice here is not useful, and developers in practice must link against the old SDK in order to avoid crashing.

Apple should provide a tool to detect SDK usage that is not compatible with the deployment target (including filtering out correct usage via weak linking, as Apple recommends). Until Apple can provide such a tool, Apple should stop removing old SDKs from Xcode.


Filed dupe: rdar://12017796

By futuretap at Aug. 2, 2012, 6:05 p.m. (reply...)

I second this

Along with the other 8 developers I work with.

Xcode should not lie

If you set a deployment target, and what Xcode compiles won't run there, it should give an error.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!