ndk icon indicating copy to clipboard operation
ndk copied to clipboard

better diagnostics for missing functions

Open DanAlbert opened this issue 8 years ago • 1 comments
trafficstars

As https://github.com/android-ndk/ndk/issues/477 (and others) have shown, our diagnostics for missing functions can be confusing.

__attribute__((availability)) should mean we get better diagnostics, but since we need to #ifdef things out to replace them with inlines for old platform versions, the compiler can't help.

We should add an __INLINE_BEFORE tag for the versioner to match __INTRODUCED_IN and teach the versioner to only #ifdef the former.

When this was first implemented, using a function that was unavailable via __attribute__((availability)) wasn't actually an error. The function would be a weak reference instead. @jmgao was considering (or perhaps already fixed, idr) adding a flag to that attribute to make it an error.

DanAlbert avatar Aug 03 '17 21:08 DanAlbert

This is mostly done. Only APIs in bionic still have this problem, because bionic still expects to be preprocessed, and we don't have a way to undo that which won't break existing builds yet (see https://github.com/android/ndk/issues/837#issuecomment-1224981111).

Will leave this open since that's still an issue, but this bug is now essentially just "remove versioner from bionic".

DanAlbert avatar Oct 17 '22 23:10 DanAlbert