diff mbox series

[16/22] mempcpy.3: SYNOPSIS: Use 'restrict' in prototypes

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

Commit Message

Alejandro Colomar March 5, 2021, 11:51 p.m. UTC
glibc uses 'restrict' in mempcpy(), wmempcpy().
Let's use it here too.

.../glibc$ grep_glibc_prototype mempcpy
string/string.h:384:
extern void *mempcpy (void *__restrict __dest,
		      const void *__restrict __src, size_t __n)
     __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype wmempcpy
wcsmbs/wchar.h:276:
extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
			  const wchar_t *__restrict __s2, size_t __n)
     __THROW;
.../glibc$

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

Patch

diff --git a/man3/mempcpy.3 b/man3/mempcpy.3
index 33c032c50..8a810e6a5 100644
--- a/man3/mempcpy.3
+++ b/man3/mempcpy.3
@@ -15,12 +15,15 @@  mempcpy, wmempcpy  \- copy memory area
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
 .B #include <string.h>
 .PP
-.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
+.BI "void *mempcpy(void *restrict " dest ", const void *restrict " src \
+", size_t " n );
 .PP
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
 .B #include <wchar.h>
 .PP
-.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
+.BI "wchar_t *wmempcpy(wchar_t *restrict " dest \
+", const wchar_t *restrict " src ,
+.BI "                  size_t " n );
 .fi
 .SH DESCRIPTION
 The