diff --git a/sys/libkern/bsearch.c b/sys/libkern/bsearch.c index 6aceaa773959..f3f318c11d77 100644 --- a/sys/libkern/bsearch.c +++ b/sys/libkern/bsearch.c @@ -74,7 +74,7 @@ bsearch(key, base0, nmemb, size, compar) p = base + (lim >> 1) * size; cmp = (*compar)(key, p); if (cmp == 0) - return ((void *)p); + return ((void *)(uintptr_t)p); if (cmp > 0) { /* key > p: move right */ base = (const char *)p + size; lim--;