[PATCH 1/3] New string function explicit_bzero (from OpenBSD).

Joseph Myers joseph@codesourcery.com
Thu Oct 6 15:49:00 GMT 2016


On Thu, 6 Oct 2016, Florian Weimer wrote:

> On 09/15/2016 03:05 PM, Zack Weinberg wrote:
> > +/* As bzero, but the compiler will not delete a call to this
> > +   function, even if S is dead after the call.  */
> > +extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1));
> 
> I would like to redirect callers to __explicit_bzero, so that shared objects
> do not accidentally pick up an implementation of explicit_bzero which may or
> may not do the right thing.

Do you have a proposed rule for when to do such redirection?  I don't 
think it should be normal to do it; any library function could potentially 
be affected by applications defining their own function with that name.

(Exporting reserved function names at public versions makes sense when 
there is a use for those functions in contexts with namespace issues, such 
as libgcc or libstdc++.)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list