bug-gnulib
[Top][All Lists]
Advanced

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

Re: SIZEOF macro


From: Eric Blake
Subject: Re: SIZEOF macro
Date: Fri, 25 Dec 2009 16:14:15 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 12/25/2009 3:58 AM:
> Pádraig Brady wrote:
>> I use LENGTHOF in my personal code.
> 
> It's certainly handy and easy to remember. But in C we often make the
> distinction between "length" (= number of elements that matter) and
> "size" (= number of elements for which room is allocated).
> The array L"abc" has length 3, as determined by wcslen, but has storage
> allocated for 4 elements.

Is there some other short but acceptable name?  Maybe COUNTOF or
ARRAY_COUNT?  END_INDEX or LAST_INDEX?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAks1R0cACgkQ84KuGfSFAYA9jwCcC0dvyLKr76fVzDIA1Z+GAp87
/lkAnA++8JG9HiAnlHanfEufq+Rd03ry
=ZSuu
-----END PGP SIGNATURE-----




reply via email to

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