Document Number: N2485
Submitter: Aaron Peter Bachmann
Submission Date: 2020-02-19
Add explicit_memset() as non-optional part of
ing.h> to C2X
something equivalent is useful to securely set or erase
memory. In Annex K there is
memset_s() but Annex K
is optional. Since most C-libraries chose not to implement Annex
K the option is less useful than desirable.
memset_s()and it is currently part of Annex K.
explicit_memset() shall behave like
with the added stipulation that the call to
is guaranteed not to be optimized away.
...zero...()since it allows to set an arbitrary value not just
explicit_memset() is used more often
, so stick with
_explicit' as suffix already i. e. -
void *memset_explicit(void *s, int c, size_t len)instead of
void *explicit_memset(void *s, int c, size_t len)seems a reasonable alternative.
In order to make
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1969.htm states: "Therefore, we propose that Annex K be either removed from the next revision of the C standard, or deprecated and then removed."
126.96.36.199 The memset function