Merge "Warn about unused results with bsearch()." into main am: b851c4c5bf

Original change: https://android-review.googlesource.com/c/platform/bionic/+/3108440

Change-Id: I792804d3ae115d65187f7240a8c847c4b3b5cc7e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2024-05-31 20:27:27 +00:00 committed by Automerger Merge Worker
commit 74e8e58109

View file

@ -105,7 +105,14 @@ __wur char* _Nullable realpath(const char* _Nonnull __path, char* _Nullable __re
*/ */
int system(const char* _Nonnull __command); int system(const char* _Nonnull __command);
void* _Nullable bsearch(const void* _Nonnull __key, const void* _Nullable __base, size_t __nmemb, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull __lhs, const void* _Nonnull __rhs)); /**
* [bsearch(3)](http://man7.org/linux/man-pages/man3/bsearch.3.html) searches
* a sorted array.
*
* Returns a pointer to a matching item on success,
* or NULL if no matching item is found.
*/
__wur void* _Nullable bsearch(const void* _Nonnull __key, const void* _Nullable __base, size_t __nmemb, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull __lhs, const void* _Nonnull __rhs));
void qsort(void* _Nullable __base, size_t __nmemb, size_t __size, int (* _Nonnull __comparator)(const void* _Nullable __lhs, const void* _Nullable __rhs)); void qsort(void* _Nullable __base, size_t __nmemb, size_t __size, int (* _Nonnull __comparator)(const void* _Nullable __lhs, const void* _Nullable __rhs));