diff mbox series

[21/24] strtok.3: SYNOPSIS: Use 'restrict' in prototypes

Message ID 20210310183149.194717-22-alx.manpages@gmail.com
State New
Headers show
Series man3: SYNOPSIS: Use 'restrict' in prototypes (batch 5) | expand

Commit Message

Alejandro Colomar March 10, 2021, 6:31 p.m. UTC
Both POSIX and glibc use 'restrict' in strtok(), strtok_r().
Let's use it here too.

.../glibc$ grep_glibc_prototype strtok
string/string.h:340:
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __THROW __nonnull ((2));
.../glibc$ grep_glibc_prototype strtok_r
string/string.h:350:
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
		       char **__restrict __save_ptr)
     __THROW __nonnull ((2, 3));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strtok.3 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/man3/strtok.3 b/man3/strtok.3
index 6db48b677..8058ff2fe 100644
--- a/man3/strtok.3
+++ b/man3/strtok.3
@@ -36,8 +36,9 @@  strtok, strtok_r \- extract tokens from strings
 .nf
 .B #include <string.h>
 .PP
-.BI "char *strtok(char *" str ", const char *" delim );
-.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr );
+.BI "char *strtok(char *restrict " str ", const char *restrict " delim );
+.BI "char *strtok_r(char *restrict " str ", const char *restrict " delim ,
+.BI "               char **restrict " saveptr );
 .fi
 .PP
 .RS -4