From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org, libc-coord@lists.openwall.com,
libstdc++ <libstdc++@gcc.gnu.org>,
gcc@gcc.gnu.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-man <linux-man@vger.kernel.org>,
Jonathan Wakely <jwakely@redhat.com>,
Florian Weimer <fweimer@redhat.com>,
Ville Voutilainen <ville.voutilainen@gmail.com>,
enh@google.com, Rusty Russell <rusty@rustcorp.com.au>,
Alejandro Colomar <colomar.6.4.3@gmail.com>
Subject: Re: Expose 'array_length()' macro in <sys/cdefs.h> or <sys/param.h>
Date: Wed, 30 Sep 2020 22:39:08 +0200 [thread overview]
Message-ID: <1aa963ec-0f44-4948-d862-7808b0b86a7a@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2009301557590.5720@digraph.polyomino.org.uk>
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
prev parent reply other threads:[~2020-09-30 20:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <946e9377-0558-3adf-3eb9-38c507afe2d0@gmail.com>
[not found] ` <874knr8qyl.fsf@oldenburg2.str.redhat.com>
2020-09-21 10:11 ` Alejandro Colomar
2020-09-21 10:33 ` Florian Weimer
2020-09-21 12:47 ` Alejandro Colomar
2020-09-21 15:47 ` [libc-coord] " enh
2020-09-22 16:25 ` Rich Felker
2020-09-22 16:44 ` Jonathan Wakely
2020-09-22 16:53 ` Ville Voutilainen
2020-09-21 14:01 ` Jonathan Wakely
2020-09-21 21:52 ` Expose 'array_length()' macro in <sys/param.h> Alejandro Colomar
2020-09-21 22:04 ` Jonathan Wakely
2020-09-21 22:13 ` Ville Voutilainen
2020-09-22 9:10 ` Alejandro Colomar
2020-09-22 9:40 ` Jonathan Wakely
2020-09-22 10:01 ` Florian Weimer
2020-09-22 10:35 ` Alejandro Colomar
2020-09-22 11:40 ` Florian Weimer
2020-09-22 14:58 ` [RFC] <sys/param.h>: Add nitems() and snitems() macros Alejandro Colomar
2020-09-25 13:20 ` [PATCH v2] " Alejandro Colomar
2020-09-25 14:10 ` Alejandro Colomar
2020-09-25 14:48 ` Jonathan Wakely
2020-09-25 16:30 ` Alejandro Colomar
2020-09-25 17:39 ` Jonathan Wakely
2020-09-25 17:42 ` Jonathan Wakely
2020-09-25 17:46 ` Alejandro Colomar
2020-09-25 19:37 ` [PATCH v3] <sys/param.h>: Add nitems() Alejandro Colomar
2020-09-22 9:16 ` [libc-coord] Re: Expose 'array_length()' macro in <sys/param.h> Florian Weimer
[not found] ` <alpine.DEB.2.21.2009301557590.5720@digraph.polyomino.org.uk>
2020-09-30 20:39 ` Alejandro Colomar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1aa963ec-0f44-4948-d862-7808b0b86a7a@gmail.com \
--to=colomar.6.4.3@gmail.com \
--cc=enh@google.com \
--cc=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=jwakely@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=libc-coord@lists.openwall.com \
--cc=libstdc++@gcc.gnu.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=ville.voutilainen@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).