mirror of https://github.com/mkerrisk/man-pages
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:
parent
98a1e7336e
commit
9112c654ed
|
@ -35,7 +35,8 @@ memcpy \- copy memory area
|
||||||
.nf
|
.nf
|
||||||
.B #include <string.h>
|
.B #include <string.h>
|
||||||
.PP
|
.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
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The
|
||||||
|
|
Loading…
Reference in New Issue