bug-gnulib
[Top][All Lists]
Advanced

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

Re: SIZEOF macro


From: Bruno Haible
Subject: Re: SIZEOF macro
Date: Sat, 26 Dec 2009 10:40:07 +0100
User-agent: KMail/1.9.9

Eric Blake wrote:
> Is there some other short but acceptable name?  Maybe COUNTOF or
> ARRAY_COUNT?  END_INDEX or LAST_INDEX?

I don't see a better name than SIZEOF:
  - The terms "length", "count", "used" etc. allude to the used portion
    of an array, not its allocated size.
  - "cardinality" is longer, for no added value.
  - The word "end_index" would be reasonable if the only use was in
    'for' loops. But when you concatenate two arrays, and you've got to write
      XNMALLOC (END_INDEX (a1) + END_INDEX (a2), type)
    you realize that it is not capturing the entire semantics.

Bruno




reply via email to

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