/[llvm-project]
ViewVC logotype

Revision 232750


Jump to revision: Previous Next
Author: nico
Date: Thu Mar 19 14:18:22 2015 CDT (19 months ago)
Changed paths: 9
Log Message:
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.

Changed paths:

Path Details
Directorycfe/trunk/include/clang/Basic/DiagnosticGroups.td modified , text changed
Directorycfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td modified , text changed
Directorycfe/trunk/include/clang/Sema/Sema.h modified , text changed
Directorycfe/trunk/lib/Sema/DelayedDiagnostic.cpp modified , text changed
Directorycfe/trunk/lib/Sema/SemaDeclAttr.cpp modified , text changed
Directorycfe/trunk/lib/Sema/SemaExpr.cpp modified , text changed
Directorycfe/trunk/test/Sema/attr-availability.c modified , text changed
Directorycfe/trunk/test/SemaObjC/attr-availability.m modified , text changed
Directorycfe/trunk/test/SemaObjC/property-deprecated-warning.m modified , text changed

llvm-admin@lists.llvm.org
ViewVC Help
Powered by ViewVC 1.1.5