This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Avoid SIGFPE in wordexp [BZ #18100]
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Roland McGrath <roland at hack dot frob dot com>, Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 20 Mar 2015 10:21:11 -0700
- Subject: Re: [PATCH] Avoid SIGFPE in wordexp [BZ #18100]
- Authentication-results: sourceware.org; auth=none
- References: <550C2BE2 dot 4000108 at redhat dot com> <20150320153707 dot GF11803 at vapier> <550C3F97 dot 4060704 at redhat dot com> <20150320165759 dot AEC7E2C3B82 at topped-with-meat dot com>
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))
and perhaps glibc should do the same.