This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]