Skip to contentSkip to conversation

memchr.3: memchr/memrchr take pointer arguments

PATCH In review nick black 2 participants 2 messages Jun 9, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

nick black

author
#0 lore raw

PATCH 1/1 memchr.3: memchr/memrchr take pointer arguments

memchr: memchr/memrchr first argument is a pointer

---
 man/man3/memchr.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man/man3/memchr.3 +2 -2
index bb598c7d4..24fbef340 100644
@@ -20,8 +20,8 @@ .SH SYNOPSIS
 .nf
 .B #include <string.h>
 .P
-.BI "void *memchr(const void " s [. n "], int " c ", size_t " n );
-.BI "void *memrchr(const void " s [. n "], int " c ", size_t " n );
+.BI "void *memchr(const void *" s [. n "], int " c ", size_t " n );
+.BI "void *memrchr(const void *" s [. n "], int " c ", size_t " n );
 .P
 .BI "[[deprecated]] void *rawmemchr(const void *" s ", int " c );
 .fi
Signature · 3 lines
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.
#1 lore raw

Hi Nick,

Quoted 12 lines · nick black

memchr: memchr/memrchr first argument is a pointer

---
 man/man3/memchr.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man/man3/memchr.3 +0 -0
index bb598c7d4..24fbef340 100644

man/man3/memchr.3 .SH SYNOPSIS · line 24

Quoted 7 lines
man/man3/memchr.3 +2 -2
@@ -20,8 +20,8 @@ .SH SYNOPSIS
 .nf
 .B #include <string.h>
 .P
-.BI "void *memchr(const void " s [. n "], int " c ", size_t " n );
-.BI "void *memrchr(const void " s [. n "], int " c ", size_t " n );
+.BI "void *memchr(const void *" s [. n "], int " c ", size_t " n );
+.BI "void *memrchr(const void *" s [. n "], int " c ", size_t " n );

But it's not an array of pointers. :)

We use array syntax, even if being a bit illegal, to document to which argument the size applies. In these functions it's more obvious, but in functions with several arguments, that's more important/useful.

Have a lovely day!
Alex

Quoted 8 lines
man/man3/memchr.3 +0 -0
 .P
 .BI "[[deprecated]] void *rawmemchr(const void *" s ", int " c );
 .fi
Signature · 4 lines
-- 
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.
Signature · 1 line
<https://www.alejandro-colomar.es/>