Closed fornwall closed 6 years ago
Likewise with strchrnul
:
#if defined(__USE_GNU)
#if defined(__cplusplus)
extern "C++" char* strchrnul(char* _Nonnull, int) __RENAME(strchrnul) __attribute_pure__;
extern "C++" const char* strchrnul(const char* _Nonnull, int) __RENAME(strchrnul) __attribute_pure__;
#else
#if __ANDROID_API__ >= 24
char* strchrnul(const char* _Nonnull, int) __attribute_pure__ __INTRODUCED_IN(24);
#endif /* __ANDROID_API__ >= 24 */
#endif
#endif
Oops, this slipped through because the tool we have to verify correctness only builds the headers in C.
Header fix at https://android-review.googlesource.com/428060, but the preprocessor needs to be updated to build with C++ as well to insert guards.
The user facing part of this is fixed, so taking off r16. @jmgao still needs to fix the versioner to make sure we don't have more mistakes like this one, but not necessary for r16 (aiui we're not going to be adding more like these anyway since libc++ already provides const-correct overloads for most of the C library).
did we introduce new problems for strcasestr and memrchr with https://android-review.googlesource.com/#/c/platform/bionic/+/455204/?
Guessing @jmgao won't be able to do any work on the versioner any time soon.
answering my own question about strcasestr and memrchr: no, they're fine because they're already surrounded by __ANDROID_API__ checks for other reasons, or were there from the beginning anyway.
AFAIK, the versioner support needed for this has been done for a while, should this be closed?
(After scrolling up and rereading the comments, yeah, looks like it.)
From
<string.h>
in NDK r15b:Is it really correct that
basename
is declared if C++ is used regardless of__ANDROID_API__
while android-23 is required for the C function?