Re: [libc-coord] Re: Expose 'array_length()' macro in or

2020-09-22 Thread Ville Voutilainen via Gcc
On Tue, 22 Sep 2020 at 19:46, Jonathan Wakely via Libstdc++ 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 *

Re: [libc-coord] Re: Expose 'array_length()' macro in or

2020-09-22 Thread Jonathan Wakely via Gcc
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.

Re: [libc-coord] Re: Expose 'array_length()' macro in or

2020-09-22 Thread Rich Felker
On Mon, Sep 21, 2020 at 02:47:51PM +0200, Alejandro Colomar wrote: > [[ CC += libc-coord at lists.openwall.com ]] I missed the beginning of this so perhaps it's already been discussed, but I don't see how cdefs.h is a remotely reasonable place for this. cdefs.h is included by all glibc headers and

Re: [libc-coord] Re: Expose 'array_length()' macro in

2020-09-22 Thread Florian Weimer via Gcc
* 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 pointe

Re: [libc-coord] Re: Expose 'array_length()' macro in or

2020-09-21 Thread enh via Gcc
Why would C++ programmers need this given https://en.cppreference.com/w/cpp/iterator/size ? On Mon, Sep 21, 2020, 05:54 Alejandro Colomar wrote: > [[ CC += libc-coord at lists.openwall.com ]] > > On 2020-09-21 12:33, Florian Weimer wrote: > > * Alejandro Colomar: > > > >> [[ > >> CC += libc-coor