[PATCH 0/2] alx-0097r1 - <memory.h>, the legitimate header for memcpy(3) et al.

Alejandro Colomar <[email protected]> Fri, 31 Jul 2026 23:18:54 +0200
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.linux.man,gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
Hi!

Here's a patch set for documenting mem*(3) and strn*(3) functions as
provided in <memory.h>.  This should put a stop to the misunderstanding
and misuse of these functions as handling strings; they handle bytes and
nonstrings (and in some cases, strings can be used as nonstrings or as
byte arrays, but very carefully).

This header is quite portable: {Free,Net,Open}BSD, glibc, and musl, at
least and since forever.

The C Committee is discussing standardization of <memory.h>, so let's
give it a bump.


Have a lovely night!
Alex


Alejandro Colomar (2):
  man/man3/{mem,strn}*(): SYNOPSIS, STANDARDS: Document these as
    provided by <memory.h>
  man/man*/{string.3,memory.h.3head}: Move functions to a new page
    memory.h(3head)

 man/man3/memccpy.3      |  5 ++-
 man/man3/memchr.3       |  5 ++-
 man/man3/memcmp.3       |  5 ++-
 man/man3/memcpy.3       |  5 ++-
 man/man3/memfrob.3      |  2 +-
 man/man3/memmem.3       |  2 +-
 man/man3/memmove.3      |  5 ++-
 man/man3/mempcpy.3      |  2 +-
 man/man3/memrchr.3      |  2 +-
 man/man3/memset.3       |  5 ++-
 man/man3/stpncpy.3      |  8 +++-
 man/man3/strcasecmp.3   |  6 +++
 man/man3/strcmp.3       |  6 +++
 man/man3/strdup.3       |  5 +++
 man/man3/strdupa.3      |  4 ++
 man/man3/string.3       | 95 +++--------------------------------------
 man/man3/strncat.3      |  5 ++-
 man/man3/strnlen.3      |  5 ++-
 man/man3head/memory.h.3 | 57 +++++++++++++++++++++++++
 19 files changed, 126 insertions(+), 103 deletions(-)
 create mode 100644 man/man3head/memory.h.3

Range-diff:
-:  ------------ > 1:  784288e70418 man/man3/{mem,strn}*(): SYNOPSIS, STANDARDS: Document these as provided by <memory.h>
-:  ------------ > 2:  668ab8c64821 man/man*/{string.3,memory.h.3head}: Move functions to a new page memory.h(3head)

base-commit: 8152eb52d9a92f02c14e843545acec7ee1946479
-- 
2.53.0
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmptET0ACgkQ64mZXMKQ
wqm10g//XKxdoEzAu87TmtSAGS5sddII3rp4UkXIVCdZPbFyROw86w7vtFtCZXAT
1Y5m/vG9yWB0IbstLzL4FuJVx688hv473jphe69qaOEIp7KxvMnkmm786VUGRtEG
HQH0QtxYyNnLVDdbqwCoOg5lKJ6n6E2BkExVevK5r/rapV7wfkhv7v2OB+wFuEkD
00cz5pf3QsD/rJh4XgpbHr0QYjo+96LvVK9/OxN3oWgRpU/UM8zQD5+g9GaF5Sr3
3qdMLwWhTPDBRsP1tc3LRQQdM7sL9ynWDCXekxsa7WJNwKojjCBmdeNfh1I5gdIc
Z74xEBUrQJIB2B6k8fV7u66xPdW75wbtvirUSxLgkiCD9P0f11uZI5Mj7yVb9ZjI
H5fL/iRVBa+S/Zgz6Y6IwakfI6WfDqZK3cVFPy/j2mAxxNRN5/3xPyggmK/Y+POJ
XSUkWLI8oZaoJTT1wF3kjfSfZIkLvaA40XAVYvzyywCvC9HSTB0ng5kOdkWGuk+O
bfC0Bmsyen7gH9JSHxxCfToP8LU1tcW8K3coPosLWBb9NFP74I+cWdVC7lGlcLc+
+GWlf4RUEiIsvlJNoHduFgfl+IrnbF4+H6oIpx5pbAXfNdSETeaCfjbYCzOs5EL8
1FUvh1RKZUtcRUIIIRfKNrAC0+LxD+pfo/2vCSkddEWYlH26Acs=
=7Uzu
-----END PGP SIGNATURE-----