Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 30 Sep 2020 22:39:08 +0200
From: Alejandro Colomar <>
To: Joseph Myers <>
 libstdc++ <>,,
 "" <>,
 linux-man <>, Jonathan Wakely <>,
 Florian Weimer <>,
 Ville Voutilainen <>,,
 Rusty Russell <>,
 Alejandro Colomar <>
Subject: Re: Expose 'array_length()' macro in <sys/cdefs.h> or <sys/param.h>

On 2020-09-30 17:58, Joseph Myers wrote:
> For some reason
> doesn't seem to have reached the agenda of a WG14 meeting yet, but adding
> a language feature like that to the standard would be another approach.

Hi Joseph,

Yes, that would be great!

I hope they add that to the language. When/if that happens, nitems() 
could be `#define nitems(arr) _Lengthof(arr)` for std >= c2x.

In the meantime, I would add this macro to libc.

Maybe gcc could add such a great feature as an extension even before the 
standard does...

Too many wishes :)

BTW, I sent a PATCH v4 that I should've sent --in-reply-to PATCH v3 in 
this thread (but I forgot to do so); I'll link to it here:



Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.