]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/: Put first <string.h> in SYNOPSIS, then comment about <memory.h> master
authorAlejandro Colomar <alx@kernel.org>
Tue, 4 Aug 2026 12:02:14 +0000 (14:02 +0200)
committerAlejandro Colomar <alx@kernel.org>
Tue, 4 Aug 2026 12:14:20 +0000 (14:14 +0200)
This is a compromise between the fact that <string.h> is the standard
header and (only slightly) most portable header file for these
functions, while hinting at the fact that it might be more appropriate
to use <memory.h> where possible.

Remove the STANDARDS and NOTES about this, since now the SYNOPSIS
contains all the necessary information.  The extra info is in
memory.h(3head), which is linked to in the SYNOPSIS.

In non-standard functions, as an exception, use the inverse order: first
put <memory.h>, and then comment about <string.h>.

Cc: Joseph Myers <josmyers@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Keith Bostic <keith@bostic.com>
Cc: Sam James <sam@gentoo.org>
Cc: Mark Harris <mark.hsj@gmail.com>
Cc: Nevin Liber <nevin@cplusplusguy.com>
Cc: JeanHeyd Meneide <phdofthehouse@gmail.com>
Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Cc: Kees Cook <keescook@chromium.org>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: bug-gnulib@gnu.org
Cc: libc-alpha@sourceware.org
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 files changed:
man/man3/memccpy.3
man/man3/memchr.3
man/man3/memcmp.3
man/man3/memcpy.3
man/man3/memfrob.3
man/man3/memmem.3
man/man3/memmove.3
man/man3/mempcpy.3
man/man3/memrchr.3
man/man3/memset.3
man/man3/stpncpy.3
man/man3/strcasecmp.3
man/man3/strcmp.3
man/man3/strdup.3
man/man3/strdupa.3
man/man3/strncat.3
man/man3/strnlen.3

index ed194d26654ef516e57147f0c9c1679dc274f933..85ed2099bc7d9feff112ccfb2e4f832be4a7a0fc 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "void *memccpy(" "size_t n;"
 .BI "              void " dest "[restrict " n "], const void " src "[restrict " n ],
@@ -67,11 +67,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, SVr4, 4.3BSD.
 .SH CAVEATS
index 4b9583ad170b95a4a6e79556cbce7abfb43a4b06..1965ef0a3b675b72262fee807fc92e3ecbfc835c 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "void *memchr(" "size_t n;"
 .BI "             const void " s [ n "], int " c ", size_t " n );
@@ -53,11 +53,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH SEE ALSO
index 806e7731d1e9ef38c683e4a25dfa56a9e2bbfe0e..4137e379ee451f2a76621fb69150800b09983c7e 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "int memcmp(" "size_t n;"
 .BI "           const void " s1 [ n "], const void " s2 [ n "], size_t " n );
@@ -70,11 +70,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH CAVEATS
index 341da553827b9b5754d5291e88e45f92dd84b614..0622a9c66b31ca6fb0dfd9bf868e0a456999a620 100644 (file)
@@ -13,7 +13,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "void *memcpy(" "size_t n;"
 .BI "             void " dest "[restrict " n "], const void " src "[restrict " n ],
@@ -53,11 +53,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH CAVEATS
index 5df5033f13253200d4aa983193b643e6cfaad303..433f3d43bc2c3c13290dfd3516f600195be367a4 100644 (file)
@@ -13,7 +13,7 @@ Standard C library
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
-.B #include <memory.h>
+.BR #include\~<memory.h> "  // or <string.h>; see memory.h(3head)"
 .P
 .BR "void *memfrob(" "size_t n;"
 .BI "              void " s [ n "], size_t " n );
@@ -55,9 +55,6 @@ T}    Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 GNU.
-.SH NOTES
-The following header also provides this function:
-.IR <string.h> .
 .SH SEE ALSO
 .BR memory.h (3head),
 .BR strfry (3)
index e092089425a582c6f0e9577348699c660a887905..0d75bc6a7806d25dc5f24b629aa825e8f036a8c2 100644 (file)
@@ -13,7 +13,7 @@ Standard C library
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
-.B #include <memory.h>
+.BR #include\~<memory.h> "  // or <string.h>; see memory.h(3head)"
 .P
 .BR "void *memmem(" "size_t hsize, size_t nsize;"
 .BI "             const void " haystack [ hsize "], size_t " hsize ,
@@ -56,9 +56,6 @@ None.
 .SH HISTORY
 musl libc 0.9.7;
 FreeBSD 6.0, OpenBSD 5.4, NetBSD, Illumos.
-.SH NOTES
-The following header also provides this function:
-.IR <string.h> .
 .SH BUGS
 .\" This function was broken in Linux libraries up to and including libc 5.0.9;
 .\" there the
index d519424fe8a1938db11611223d54f36fa211cc63..3bd63c437be528572f6d396975015c2339952f17 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "void *memmove(" "size_t n;"
 .BI "              void " dest [ n "], const void " src [ n "], size_t " n );
@@ -56,11 +56,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH SEE ALSO
index 285227d762d6d5a8ff39a1e7818c9f7f12c30fd8..63288233793e7f0d5a6872e41e9feba1ccbb52dd 100644 (file)
@@ -14,7 +14,7 @@ Standard C library
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
-.B #include <memory.h>
+.BR #include\~<memory.h> "  // or <string.h>; see memory.h(3head)"
 .P
 .BR "void *mempcpy(" "size_t n;"
 .BI "              void " dest "[restrict " n "], const void " src "[restrict " n ],
@@ -76,10 +76,6 @@ T}   Thread safety   MT-Safe
 GNU.
 .SH HISTORY
 glibc 2.1.
-.SH NOTES
-The following header also provides
-.BR mempcpy ():
-.IR <string.h> .
 .SH EXAMPLES
 .EX
 void *
index 550585f2566e7fcc179a11f48587485941276752..901edb10f07d7573abaca60684a5a428291d5db1 100644 (file)
@@ -13,7 +13,7 @@ Standard C library
 .SH SYNOPSIS
 .nf
 .BR #define\~_GNU_SOURCE "  // See feature_test_macros(7)"
-.B #include <memory.h>
+.BR #include\~<memory.h> "  // or <string.h>; see memory.h(3head)"
 .P
 .BR void\~*memrchr( size_t\~n;
 .BI "              const void " s [ n "], int " c ", size_t " n );
@@ -48,9 +48,6 @@ T}    Thread safety   MT-Safe
 GNU.
 .SH HISTORY
 glibc 2.2.
-.SH NOTES
-The following header also provides this function:
-.IR <string.h> .
 .SH SEE ALSO
 .BR memory.h (3head),
 .BR memchr (3),
index 968ef5ebb5c9ea7a5a4881b0d270606be0f6007e..d04256c2990a2cb5df0355bccc6f624e5ccf348f 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "void *memset(" "size_t n;"
 .BI "             void " s [ n "], int " c ", size_t " n );
@@ -48,11 +48,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH SEE ALSO
index 1ff292ba5f02754cc0c1e6806810340049fe3739..d15deb4f916324fc3779a8076e34b27f2d8f2d20 100644 (file)
@@ -14,7 +14,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "char *strncpy(" "size_t dsize;"
 .BI "              char " dst "[restrict " dsize "], const char *restrict " src ,
@@ -97,19 +97,9 @@ T}   Thread safety   MT-Safe
 .TP
 .BR strncpy ()
 C11, POSIX.1-2008.
-.IP
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .TP
 .BR stpncpy ()
 POSIX.1-2008.
-.IP
-POSIX declares this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 .TP
 .BR strncpy ()
index c9fb2732cd227eaf77955adfab663f9a2ae2be5d..64c9e813c7bf01e1c554ba9ead23081245383fba 100644 (file)
@@ -16,7 +16,7 @@ Standard C library
 .P
 .BI "int strcasecmp(const char *" s1 ", const char *" s2 );
 .P
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BI "int strncasecmp(const char " s1 "[], const char " s2 "[], size_t " n );
 .fi
@@ -73,11 +73,6 @@ T}   Thread safety   MT-Safe locale
 .TE
 .SH STANDARDS
 POSIX.1-2008.
-.P
-POSIX declares both functions in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 4.4BSD, POSIX.1-2001.
 .P
index 9af0a43f45496a10a589557bf693ad1b6857f298..711b7cf5b08220827e5084e75b094c9b0ad1efbd 100644 (file)
@@ -17,7 +17,7 @@ Standard C library
 .P
 .BI "int strcmp(const char *" s1 ", const char *" s2 );
 .P
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "int strncmp(const char " s1 "[], const char " s2 "[], size_t " n );
 .fi
@@ -110,11 +110,6 @@ from the last compared byte in
 (If the two characters are equal, this difference is 0.)
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare both functions in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH EXAMPLES
index 6ed3d00f46e0a17e36e5f6b3897ae331b20eee80..980f1a20e6850669e5f09b7c23f87124476e66bc 100644 (file)
@@ -16,7 +16,7 @@ Standard C library
 .P
 .BI "char *strdup(const char *" s );
 .P
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "char *strndup(" "size_t n;"
 .BI "              const char " s [ n "], size_t " n );
@@ -95,11 +95,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 POSIX.1-2008.
-.P
-POSIX declares both functions in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 .TP
 .BR strdup ()
index cead63178491f609cd7ca15c22cc2a950cc5e56f..b541d10e5920cb5fb7c15c50b0c7156c06ea4965 100644 (file)
@@ -18,7 +18,7 @@ Standard C library
 .BI "char *strdupa(const char *" s );
 .P
 .BR "#define _GNU_SOURCE" "  /* See feature_test_macros(7) */"
-.B #include <memory.h>
+.BR #include\~<memory.h> "  // or <string.h>; see memory.h(3head)"
 .P
 .BR "char *strndupa(" "size_t n;"
 .BI "              const char " s [ n "], size_t " n );
@@ -79,10 +79,6 @@ T}   Thread safety   MT-Safe
 GNU.
 .SH HISTORY
 GNU.
-.SH NOTES
-The following header also provides
-.BR strndupa ():
-.IR <string.h> .
 .SH SEE ALSO
 .BR memory.h (3head),
 .BR alloca (3),
index 9add01ba10cf07fa4244c1e116a5442bcb407b1e..157072134c935f9c46a6075f519b2d44599db991 100644 (file)
@@ -11,7 +11,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "char *strncat(" "size_t ssize;"
 .BI "              char *restrict " dst ", const char " src "[restrict " ssize ],
@@ -57,11 +57,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 C11, POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2001, C89, SVr4, 4.3BSD.
 .SH CAVEATS
index 9faf511638ca89903e92bf7ae8a84621a52842fc..0b08923f061f2197eccb05d7cd011c75e2d63af8 100644 (file)
@@ -12,7 +12,7 @@ Standard C library
 .RI ( libc ,\~ \-lc )
 .SH SYNOPSIS
 .nf
-.BR #include\~<memory.h> "  // See STANDARDS"
+.BR #include\~<string.h> "  // or <memory.h>; see memory.h(3head)"
 .P
 .BR "size_t strnlen(const char " s "[], size_t " maxlen );
 .fi
@@ -83,11 +83,6 @@ T}   Thread safety   MT-Safe
 .TE
 .SH STANDARDS
 POSIX.1-2008.
-.P
-ISO C and POSIX declare this function in
-.IR <string.h> ;
-see
-.BR memory.h (3head).
 .SH HISTORY
 POSIX.1-2008.
 .SH SEE ALSO