[RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.

Rich Felker dalias@libc.org
Tue Dec 16 19:19:00 GMT 2014


On Tue, Dec 16, 2014 at 09:08:55PM +0300, Alexander Monakov wrote:
> > But in the case of a function like:
> > 
> > 	int foo = 42;
> > 	memset(&foo, 0, sizeof foo);
> > 	__asm__ __volatile__ ( "" : : : "memory" );
> 
> Note that the asm in the proposed patch is written in a different way: it
> accepts the address of the memset 'dest' pointer.  I don't understand why you
> said "as long the asm has no way of observing the output of memset" while it
> clearly can do so via the passed pointer.

I looked at the asm a couple times and somehow missed seeing that.
Sorry for the noise. I believe it's correct as written then.

Rich



More information about the Libc-alpha mailing list