[libc-commits] [libc] [libc] don't over include stdlib in the hdr declaring bsearch (PR #89471)
    via libc-commits 
    libc-commits at lists.llvm.org
       
    Fri Apr 19 16:14:11 PDT 2024
    
    
  
enh-google wrote:
interestingly, it looks like bionic and glibc disagree on the nullability? bionic has
```
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));
```
iirc we went with a non-null base, but found too much code that felt that that should be fine as long as nmemb is 0 (and our implementation was fine with that anyway).
https://github.com/llvm/llvm-project/pull/89471
    
    
More information about the libc-commits
mailing list