Implement C23 memset_explicit (bug 32378)

Paul Eggert eggert@cs.ucla.edu
Sun Sep 28 16:08:54 GMT 2025


On 2025-09-27 16:42, Collin Funk wrote:
> The memccpy case is a bit different since glibc has had that function
> for a very long time.

Sure, but that was just the first case I ran into. There are other cases 
not so ancient, e.g., explicit_bzero.

Besides, we shouldn't be looking at this from an archaeological 
viewpoint. We should look at it from the point of view of people 
maintaining user programs, which is the whole point of being shy about 
declaring memset_explicit. What is the benefit of hiding the 
declaration, for a user program? I don't see anything of any real 
significance.

If __USE_MISC is the wrong symbol (which I doubt), then use a different 
one. The point is that memset_explicit should be visible unless the user 
asks to check to an older API by using something like -std=c99 without 
defining _GNU_SOURCE. That is what FreeBSD does; why should we differ?


More information about the Libc-alpha mailing list