[PATCH] Avoid SIGFPE in wordexp [BZ #18100]

Mike Frysinger vapier@gentoo.org
Fri Mar 20 18:13:00 GMT 2015


On 20 Mar 2015 10:21, Paul Eggert wrote:
> Roland McGrath wrote:
> >> Sadly, glibc does not seem to provide an ARRAY_SIZE macro for global use.
> >
> > If you want one, put it in libc-internal.h.
> 
> I suggest avoiding the name 'ARRAY_SIZE', as a size is typically a byte count, 
> e.g., what 'sizeof' returns.  To help avoid this confusion GNU Emacs uses the 
> name 'ARRAYELTS' internally, in src/lisp.h:
> 
> #define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0])
> 
> and perhaps glibc should do the same.

i can't say i've ever seen that confusion.  considering glibc tends to have a 
lot of kernel hackers, and libiberty itself uses ARRAY_SIZE, i think it'd be
more natural for us to use that.  i'm not sure i've ever seen someone refer to
emacs as the way to do things before ;).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150320/dcbc4e39/attachment.sig>


More information about the Libc-alpha mailing list