pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
The return pointer is derived from the argument pointer cx. If cx is created from a shared reference, that means it is UB to write to the return pointer. Casting const ptr to mut ptr has been involved in a bunch of UB cases, so having that done implicitly by the libc seems pretty bad.
If libc 1.0 APIs can still be changed, I'd strongly recommend using *const for the return type.
The return pointer is derived from the argument pointer
cx. Ifcxis created from a shared reference, that means it is UB to write to the return pointer. Casting const ptr to mut ptr has been involved in a bunch of UB cases, so having that done implicitly by the libc seems pretty bad.If libc 1.0 APIs can still be changed, I'd strongly recommend using
*constfor the return type.