Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o8lyyxwm.fsf@oldenburg2.str.redhat.com>
Date: Tue, 22 Sep 2020 11:16:09 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Jonathan Wakely <jwakely@...hat.com>
Cc: Alejandro Colomar <colomar.6.4.3@...il.com>,
  libc-coord@...ts.openwall.com,  gcc@....gnu.org,  libstdc++@....gnu.org,
  Libc-alpha <libc-alpha@...rceware.org>
Subject: Re: Re: Expose 'array_length()' macro in <sys/param.h>

* Jonathan Wakely:

>>#  define array_length(arr)	(std:size(arr))
>
> C++ programmers will not accept a macro for this.

I think we need a macro for C++98 support because there is no other way
to produce constant expression.

Note that this intended for C programs compiled in C++ mode.  As pointed
out, new C++ code should rather use std::size.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill

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.