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] Avoid SIGFPE in wordexp [BZ #18100]


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

Attachment: signature.asc
Description: Digital signature


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