Here's a proposed set of patches to add support for C23's memset_explicit function, along with the corresponding fallout in Gnulib. The idea is to prefer memset_explicit, but continue to support explicit_bzero (which is not marked as obsolescent, as it's too soon for that). Comments welcome.
Paul Eggert (4): memset_explicit: new module read-file: use memset_explicit explicit_bzero: memset_explicit is standard explicit_bzero: implement via memset_explicit ChangeLog | 29 ++++ MODULES.html.sh | 8 + doc/glibc-functions/explicit_bzero.texi | 4 + doc/gnulib.texi | 2 + doc/posix-functions/memset_explicit.texi | 43 +++++ lib/explicit_bzero.c | 69 ++------ lib/memset_explicit.c | 62 +++++++ lib/read-file.c | 12 +- lib/string.in.h | 17 ++ m4/explicit_bzero.m4 | 7 +- m4/memset_explicit.m4 | 20 +++ m4/string_h.m4 | 6 +- modules/explicit_bzero | 4 +- modules/memset_explicit | 31 ++++ modules/memset_explicit-tests | 14 ++ modules/read-file | 2 +- modules/string | 2 + tests/test-memset_explicit.c | 203 +++++++++++++++++++++++ 18 files changed, 460 insertions(+), 75 deletions(-) create mode 100644 doc/posix-functions/memset_explicit.texi create mode 100644 lib/memset_explicit.c create mode 100644 m4/memset_explicit.m4 create mode 100644 modules/memset_explicit create mode 100644 modules/memset_explicit-tests create mode 100644 tests/test-memset_explicit.c -- 2.37.2