[PATCH] manual: Update memchr description [BZ #19406]

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Jun 15 16:26:50 GMT 2026


Update memchr description to indicate it cannot overread and the
size input may be larger than the object passed.  This is required
since C11. Fixes BZ 19406.

OK for commit?

---

diff --git a/manual/string.texi b/manual/string.texi
index 24004f1f5cc60b70bafde0794351734a4eb1ce2b..793fbd230163d09390232ede67225f68b6ea6e4a 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -1803,6 +1803,10 @@ to an @code{unsigned char}) in the initial @var{size} bytes of the
 object beginning at @var{block}.  The return value is a pointer to the
 located byte, or a null pointer if no match was found.
 
+This function behaves as if each byte is read sequentially and stops as
+soon as the first match is found.  @var{size} may be larger than the object
+starting at @var{block} if there is a match within the object.
+
 In ISO C23 and later, this function is qualifier-generic:
 that is, it is also implemented as a function-like macro,
 and when the macro is used and @var{block} has a type



More information about the Libc-alpha mailing list