[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIZEOF macro
From: |
Bruno Haible |
Subject: |
Re: SIZEOF macro |
Date: |
Fri, 25 Dec 2009 11:58:19 +0100 |
User-agent: |
KMail/1.9.9 |
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.
See also the fields 'size' and 'length' in lib/linebuffer.h.
I like the name SIZEOF also because it gets this distinction right.
Bruno
- Re: SIGNATURE_CHECK, (continued)
- Re: ASSERT macro, Bruno Haible, 2009/12/24
- SIZEOF macro (was: ASSERT macro), Eric Blake, 2009/12/24
- Re: SIZEOF macro, Eric Blake, 2009/12/24
- Re: SIZEOF macro, Jim Meyering, 2009/12/25
- Re: SIZEOF macro, Jim Meyering, 2009/12/25
- Re: SIZEOF macro, Ben Pfaff, 2009/12/24
- Re: SIZEOF macro, Bruno Haible, 2009/12/24
- Re: SIZEOF macro, Pádraig Brady, 2009/12/24
- Re: SIZEOF macro,
Bruno Haible <=
- Re: SIZEOF macro, Eric Blake, 2009/12/25
- Re: SIZEOF macro, Bruno Haible, 2009/12/26
- Re: ASSERT macro, Eric Blake, 2009/12/26
- Re: ASSERT macro, Bruno Haible, 2009/12/26