From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Rich Felker <dalias@libc.org>,
Florian Weimer <fweimer@redhat.com>,
gcc@gcc.gnu.org, "libstdc++" <libstdc++@gcc.gnu.org>,
Libc-alpha <libc-alpha@sourceware.org>,
libc-coord@lists.openwall.com
Subject: Re: [libc-coord] Re: Expose 'array_length()' macro in <sys/cdefs.h> or <sys/param.h>
Date: Tue, 22 Sep 2020 19:53:48 +0300 [thread overview]
Message-ID: <CAFk2RUZ5gi_264UeoM3OyDtXxNYPXnaDkPPBrnVe57qwcFqssA@mail.gmail.com> (raw)
In-Reply-To: <20200922164456.GY6061@redhat.com>
On Tue, 22 Sep 2020 at 19:46, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> On 22/09/20 12:25 -0400, Rich Felker wrote:
> >Is there really a reason to want a nonstandard macro like this to do
> >something that's already trivial to do in the base language and has a
> >standard idiom (sizeof x / sizeof *x)?
>
> IMHO no.
While it's anciently stupid that that trick needs to be learned by
every programmer instead of having
something straightforward readily available, I can't become a fan of
this direction when it introduces
lowercase macros that might clash with something existing or something
that other people will want to write.
And yes, I know, we can't do any better in C, due to array decay.
next prev parent reply other threads:[~2020-09-22 16:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 23:00 Alejandro Colomar
2020-09-21 8:38 ` Florian Weimer
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 [this message]
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
2020-09-30 15:58 ` Expose 'array_length()' macro in <sys/cdefs.h> or <sys/param.h> Joseph Myers
2020-09-30 20:39 ` Alejandro Colomar
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=CAFk2RUZ5gi_264UeoM3OyDtXxNYPXnaDkPPBrnVe57qwcFqssA@mail.gmail.com \
--to=ville.voutilainen@gmail.com \
--cc=dalias@libc.org \
--cc=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=libc-coord@lists.openwall.com \
--cc=libstdc++@gcc.gnu.org \
/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).