bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIZEOF macro


From: Ben Pfaff
Subject: Re: SIZEOF macro
Date: Thu, 24 Dec 2009 15:39:04 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> Hmm.  macros.h defines SIZEOF, and test-argv-iter.c defines
> ARRAY_CARDINALITY, both of which are used to determine the size of an
> array.  I kind of prefer the name in test-argv-iter (to me, sizeof implies
> a size_t count of bytes, not the number of elements).  Is it okay to
> rename the macro in macros.h to ARRAY_CARDINALITY, adjust all callers, and
> to simplify test-argv-iter?

ARRAY_CARDINALITY is very clear, but it is also a very long name.
ARRAY_SIZE is perhaps slightly less clear, but much shorter.  It
is used in gnulib in lib/nproc.c and lib/physmem.c.
-- 
Ben Pfaff 
http://benpfaff.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]