memcpy.3: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of memcpy()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

It's especially important in memcpy(),
as it's been a historical source of bugs.

......

.../glibc$ grep_glibc_prototype memcpy
posix/regex_internal.h:746:
{
  memcpy (dest, src, sizeof (bitset_t));
string/string.h:43:
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
		     size_t __n) __THROW __nonnull ((1, 2));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-02-24 15:42:55 +01:00 committed by Michael Kerrisk
parent 98a1e7336e
commit 9112c654ed
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ memcpy \- copy memory area
.nf
.B #include <string.h>
.PP
.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n );
.BI "void *memcpy(void *restrict " dest ", const void *restrict " src \
", size_t " n );
.fi
.SH DESCRIPTION
The