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: [PATCH RFC] explicit_bzero, again


On Sun, 9 Aug 2015, Zack Weinberg wrote:

> 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist

sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist also needs 
updating.

> +libc_hidden_def(__memset_chk)

Missing space before '('.

> +/* used by __explicit_bzero_chk */
> +libc_hidden_proto(__memset_chk)

Likewise.  Uppercase at start of comment, ".  " at end.

> +__explicit_bzero_constn(void *__s, size_t __n)

Missing space before '('.

> +{
> +  typedef struct {char __x[__n];} __memblk;
> +  memset(__s, 0, __n);

Likewise.

> +  __asm__ ("" : : "m" (*(__memblk __attribute__ ((may_alias)) *)__s));

I think you should use __may_alias__ here (there's no reason to take the 
symbol may_alias from the user's namespace, notwithstanding that this is 
__USE_MISC).

> +                  ? __explicit_bzero_constn(s, n)       \
> +                  : explicit_bzero(s, n)))

More missing spaces.

> @@ -90,6 +91,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len))
>    return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
>  }
>  
> +
>  #ifdef __USE_MISC
>  __fortify_function void
>  __NTH (bcopy (const void *__src, void *__dest, size_t __len))

Stray patch hunk adding a blank line.

> +      __asm__ ("" : : "m" (*(__memblk __attribute__ ((may_alias)) *)__dest));

__may_alias__ again.

> +    __explicit_bzero_chk(__dest, __len, __bos (__dest));
> +  else
> +    __explicit_bzero_alias(__dest, __len);

More missing spaces.

-- 
Joseph S. Myers
joseph@codesourcery.com


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