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

Paul Eggert eggert@cs.ucla.edu
Fri Mar 20 17:21:00 GMT 2015


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.



More information about the Libc-alpha mailing list