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 <colomar.6.4.3@...il.com>
To: Joseph Myers <joseph@...esourcery.com>
Cc: libc-alpha@...rceware.org, libc-coord@...ts.openwall.com,
 libstdc++ <libstdc++@....gnu.org>, gcc@....gnu.org,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 linux-man <linux-man@...r.kernel.org>, Jonathan Wakely <jwakely@...hat.com>,
 Florian Weimer <fweimer@...hat.com>,
 Ville Voutilainen <ville.voutilainen@...il.com>, enh@...gle.com,
 Rusty Russell <rusty@...tcorp.com.au>,
 Alejandro Colomar <colomar.6.4.3@...il.com>
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 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2529.pdf
> 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:

https://sourceware.org/pipermail/libc-alpha/2020-September/117986.html

Thanks,

Alex

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.