[Bug string/21018] Add memcchr function

eggert at gnu dot org sourceware-bugzilla@sourceware.org
Fri Jan 13 16:15:00 GMT 2017


https://sourceware.org/bugzilla/show_bug.cgi?id=21018

Paul Eggert <eggert at gnu dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eggert at gnu dot org

--- Comment #3 from Paul Eggert <eggert at gnu dot org> ---
The FreeBSD memcchr is a kernel function, not a C library function, so it's not
really a precedent.

I've seen similar functions in application code (e.g., all_zeros in
grep/src/grep.c, zero_block_p in src/tar/sparse.c). The functions are easy to
write, not likely to be wrong, and not a performance bottleneck since they are
typically applied to input data and the cost of input dwarfs the cost of
running the function. Since these functions would need to be retained in the
source code anyway (which needs to be portable to non-glibc systems) from an
application viewpoint there doesn't seem to be much advantage to adding this
functionality to the glibc API.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list