HomePhabricator

Add -Wpartial-availability.

Description

Add -Wpartial-availability.

This warns when using decls that are not available on all deployment targets.
For example, a call to

  • (void)ppartialMethod attribute((availability(macosx,introduced=10.8)));

will warn if -mmacosx-version-min is set to less than 10.8.

To silence the warning, one has to explicitly redeclare the method like so:

@interface Whatever(MountainLionAPI)
- (void)ppartialMethod;
@end

This way, one cannot accidentally call a function that isn't available
everywhere. Having to add the redeclaration will hopefully remind the user
to add an explicit respondsToSelector: call as well.

Some projects build against old SDKs to get this effect, but building against
old SDKs suppresses some bug fixes -- see http://crbug.com/463171 for examples.
The hope is that SDK headers are annotated well enough with availability
attributes that new SDK + this warning offers the same amount of protection
as using an old SDK.

Details

Committed
nicoMar 19 2015, 12:18 PM
Parents
rL232749: Remove .CUDAIsDevice flags from CodeGenOpts as it's already
Branches
Unknown
Tags
Unknown