Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFk2RUZ5gi_264UeoM3OyDtXxNYPXnaDkPPBrnVe57qwcFqssA@mail.gmail.com>
Date: Tue, 22 Sep 2020 19:53:48 +0300
From: Ville Voutilainen <ville.voutilainen@...il.com>
To: Jonathan Wakely <jwakely@...hat.com>
Cc: Rich Felker <dalias@...c.org>, Florian Weimer <fweimer@...hat.com>, gcc@....gnu.org, 
	"libstdc++" <libstdc++@....gnu.org>, Libc-alpha <libc-alpha@...rceware.org>, 
	libc-coord@...ts.openwall.com
Subject: Re: Re: Expose 'array_length()' macro in <sys/cdefs.h>
 or <sys/param.h>

On Tue, 22 Sep 2020 at 19:46, Jonathan Wakely via Libstdc++
<libstdc++@....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.

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.