Re: [RFC v3 3/3] c: Add __lengthof__() operator

2024-08-05 Thread Alejandro Colomar
Hi Martin, On Mon, Aug 05, 2024 at 06:05:15PM GMT, Martin Uecker wrote: > > > > However, if I turn on -Wvla, both get a warning: > > > > len.c: At top level: > > len.c:288:1: warning: ISO C90 forbids variable length array ‘x’ [-Wvla] > > 288 | void foo(char (*a)[3][*], int (*x)[__l

Re: [RFC v3 3/3] c: Add __lengthof__() operator

2024-08-05 Thread Alejandro Colomar
t; > > On Mon, Aug 05, 2024 at 11:45:56AM +0200, Alejandro Colomar wrote: > > > > > [CC += Kees, Qing] > > > > > > > > > > Hi Joseph, > > > > > > > > > > On Sun, Aug 04, 2024 at 08:34:24PM GMT, Alejandro Colomar w

[RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
10]):89 lengthof(v): 44 lengthof(z): 0 lengthof(memberof(struct s, y)): 8 alignof(memberof(struct s, z)): 4 lengthof(struct {int x;}[i++]): 4; i: 5 sizeof(struct {int x;}[i++]):16; i: 5 alignof(struct {int x

[RFC v4 1/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-08-06 Thread Alejandro Colomar
_linear_ctor): Likewise. gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar --- gcc/c/c-decl.cc | 10 +-

[RFC v4 2/4] Merge definitions of array_type_nelts_top()

2024-08-06 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing __lengthof__(). Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for __lengthof__(). Signed-off-by: Alejandro Colomar --- gcc/cp/cp-t

[RFC v4 4/4] testsuite: Add tests for __lengthof__

2024-08-06 Thread Alejandro Colomar
I've compiled those files manually, and they behave as expected. But within the test-suite, they don't seem to work: FAIL: gcc.dg/lengthof-compile.c (test for excess errors) FAIL: gcc.dg/lengthof.c (test for excess errors) Signed-off-by: Alejandro Colomar --- gcc

[RFC v4 3/4] c: Add __lengthof__() operator (n2529)

2024-08-06 Thread Alejandro Colomar
Jelinek Cc: Kees Cook Cc: Qing Zhao Cc: Jens Gustedt Signed-off-by: Alejandro Colomar --- gcc/c-family/c-common.cc | 26 + gcc/c-family/c-common.def | 3 + gcc/c-family/c-common.h | 2 + gcc/c/c-decl.cc | 20 +-- gcc/c/c-parser.cc | 61 +++--

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
On Tue, Aug 06, 2024 at 02:22:38PM GMT, Alejandro Colomar wrote: > Hi! > > v4: > > - Only evaluate the operand if the top array is VLA. Inner VLAs are >ignored. [Joseph, Martin] >This proved very useful for compile-time diagnostics, since we have >more

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Hi Martin, On Tue, Aug 06, 2024 at 03:37:13PM GMT, Martin Uecker wrote: > Am Dienstag, dem 06.08.2024 um 14:22 +0200 schrieb Alejandro Colomar: > > Hi! > > > > - The tests seem to work as expected if I compile them manually, and > >run (the one that should be run

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Hi Martin, On Tue, Aug 06, 2024 at 04:43:27PM GMT, Martin Uecker wrote: > > When running `make check -j24 -Orecurse |& tee log`, this is what I see: > > > > FAIL: gcc.dg/lengthof-compile.c (test for excess errors) > > > > Is there any way to see more details? > > See gcc/testsuite/g

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
[CC += David, Florian, Andreas] On Tue, Aug 06, 2024 at 03:59:11PM GMT, Qing Zhao wrote: > Hi, Alex, Hi Qing, > I noticed that all your 4 versions of the patches and the > corresponding discussion are all in the same email thread, it’s very > inconvenient to read. Can you start a new email threa

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Hi Joseph! On Tue, Aug 06, 2024 at 05:38:50PM GMT, Joseph Myers wrote: > On Tue, 6 Aug 2024, Alejandro Colomar wrote: > > > - The tests seem to work as expected if I compile them manually, and > >run (the one that should be run) as a normal program. The one that > &

Re: [RFC v4 3/4] c: Add __lengthof__() operator (n2529)

2024-08-06 Thread Alejandro Colomar
chive, > https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659593.html, > yst, I see the quoting format issue you mentioned, adjusted my mail client > setting, > hopefully this time it’s good) Yup; it's good now. Thanks! ;) > > On Aug 6, 2024, at 08:22, Alejandro Colomar

Re: [RFC v4 3/4] c: Add __lengthof__() operator (n2529)

2024-08-06 Thread Alejandro Colomar
On Tue, Aug 06, 2024 at 10:38:55PM GMT, Alejandro Colomar wrote: > Hi Qing, > > On Tue, Aug 06, 2024 at 08:15:50PM GMT, Qing Zhao wrote: > > Some comments on the documentation part. > > > > (Hopefully, this time my quoting format is good, I checked the email &

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Hi Joseph, On Tue, Aug 06, 2024 at 08:50:19PM GMT, Joseph Myers wrote: > static int f(), f2(); > int a[10][10]; > int x; > > void > g() > { > __lengthof__ (a[f()]); // Should be valid that f is not defined. > int b[x][x]; > __lengthof__ (b[f2()]); // Should be invalid that f2 is not defined

Re: [RFC v4 0/4] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Hi Martin, On Tue, Aug 06, 2024 at 04:43:27PM GMT, Martin Uecker wrote: > There are also *.sum files which you can diff against a build > without your patch to see whether there are any regressions. In my working copy, it all looks good. Thanks! I'll mention that in v5. Have a lovely night! Al

[PATCH v5 0/3] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
Native configuration is x86_64-pc-linux-gnu === libstdc++ tests === Alejandro Colomar (3): gcc/: Rename array_type_nelts() => array_type_nelts_minus_one() Merge definitions of array_type_nelts_top() c: Add __lengthof__ operator gcc/c-family/c-common

[PATCH v5 2/3] Merge definitions of array_type_nelts_top()

2024-08-06 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top): * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc | 13 -

[PATCH v5 1/3] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-08-06 Thread Alejandro Colomar
_linear_ctor): Likewise. gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar --- gcc/c/c-decl.cc | 10 +-

[PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
: * gcc.dg/lengthof.c: Add tests for __lengthof__ operator. Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2529.pdf Link: https://inbox.sourceware.org/gcc/m8s4oqy--...@tutanota.com/T/ Suggested-by: Xavier Del Campo Romero Co-developed-by: Martin Uecker Signed-off-by: Alejandro Colomar

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
On Wed, Aug 07, 2024 at 01:12:17AM GMT, Alejandro Colomar wrote: > This operator is similar to sizeof but can only be applied to an array, > and returns its length (number of elements). > > FUTURE DIRECTIONS: > > We could make it work with array parameters to function

Re: [PATCH v5 0/3] c: Add __lengthof__ operator

2024-08-06 Thread Alejandro Colomar
is bouncing. FYI. I've removed it. On Wed, Aug 07, 2024 at 01:12:00AM GMT, Alejandro Colomar wrote: > Hi! > > This is ready for review. > > v5: > > - Add changelog entries. > - Wording fixes in commit messages. > - s/sizeof/lengthof/ in comment. > - C

Re: [PATCH v5 0/3] c: Add __lengthof__ operator

2024-08-07 Thread Alejandro Colomar
Hi David, On Wed, Aug 07, 2024 at 10:11:12AM GMT, david.brown wrote: > Hi,The address david.br...@hesbynett.no is not bouncing.  Its my email > address, and I'm getting the emails in this discussion just fine. Ahh, sorry, I didn't read the bounce notification properly; the address is indeed reach

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-07 Thread Alejandro Colomar
Hi Martin, On Wed, Aug 07, 2024 at 09:13:07AM GMT, Martin Uecker wrote: > Am Mittwoch, dem 07.08.2024 um 01:12 +0200 schrieb Alejandro Colomar: > > +#define c_parser_lengthof_expressi

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-07 Thread Alejandro Colomar
Hi Martin, On Wed, Aug 07, 2024 at 12:07:00PM GMT, Martin Uecker wrote: > > > void foo(char (*a)[*], int x[*]); > > > void foo(char (*a)[*], int x[__lengthof__(*a)]); > > > > But [*] is a VLA. Do we want to return a constexpr for it? > > No, my point is only that we could have a test for not >

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-07 Thread Alejandro Colomar
Hi Jens, Joseph, On Wed, Aug 07, 2024 at 05:30:13PM GMT, Jens Gustedt wrote: > Hi > > Am 7. August 2024 17:05:48 MESZ schrieb Joseph Myers : > > On Wed, 7 Aug 2024, Alejandro Colomar wrote: > > > > > +@node Length > > > +@section Determining the L

[PATCH v12 3/4] Merge definitions of array_type_nelts_top()

2024-08-31 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc

Re: VLA is a misnomer (rebuttal to n3187)

2024-09-01 Thread Alejandro Colomar
7;s an abuse, I think. > > So I would recommend not to go this way. You would need a really > good argument to convince me to vote for this, and I haven't seen > any such argument. How about the above? Have a lovely night! Alex > > Martin > > > > Am Sonnt

[PATCH v12 0/4] c: Add __nelementsof__ operator

2024-08-31 Thread Alejandro Colomar
quot; (with some votes for "lenght", but not so many), and the rest of the properties of the operator don't seem to be questioned. Martin, Joseph, can you please review and merge? Thanks! Have a lovely day! Alex Alejandro Colomar (4): contrib/: Add support for Cc: and L

[PATCH v12 1/4] contrib/: Add support for Cc: and Link: tags

2024-08-31 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

VLA is a misnomer (rebuttal to n3187)

2024-09-01 Thread Alejandro Colomar
Hi Jens, Martin, On Wed, Aug 14, 2024 at 05:44:57PM GMT, Jens Gustedt wrote: > Am 14. August 2024 16:47:32 MESZ schrieb Alejandro Colomar : > > > > I was thinking of renaming the proposal to elementsof(), to avoid > > > > confusion between length of an array and len

[PATCH v12 4/4] c: Add __nelementsof__ operator

2024-08-31 Thread Alejandro Colomar
azley Cc: Ville Voutilainen Cc: Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Suggested-by: Xavier Del Campo Romero Co-authored-by: Martin Uecker Signed-off-by: Alejandro Colomar --- gcc/c-family/c-common.cc | 26 gcc/c-family/c-common.def

[PATCH v12 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-08-31 Thread Alejandro Colomar
gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Cc: Gabriel Ravier Cc: Martin Uecker Cc: Joseph Myers Cc: Xavier Del Campo Romero Cc: Jakub Jelinek Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 08:45:48AM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 02:09:52AM +0200, Alejandro Colomar wrote: > > On the other hand, should we provide a version of the operator that is > > free from pedantic warnings? A GNU extension? > > No, why

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Jakub, On Tue, Oct 08, 2024 at 10:25:24AM GMT, Jakub Łukasiewicz wrote: > I think it would be beneficial to have different syntax/spelling for > features still in development. That way we, as a committee, can tweak it as > we please, while mitigating effect on early adopters. > > If what ends

Re: [PATCH 0/5] Provide better definitions of NULL

2024-10-13 Thread Alejandro Colomar
Hi Joseph, On Fri, Oct 11, 2024 at 01:44:36PM GMT, Alejandro Colomar wrote: > Hi, > > This is just an untested draft. If there's rough agreement that this is > wanted, I'll test it, write changelog, etc. > > The intention of this change is to help improve the co

Re: [PATCH 0/5] Provide better definitions of NULL

2024-10-14 Thread Alejandro Colomar
Hi Jason, You've recently touched code about C++ modules. Do you have any idea of why my changes may be introducing regressions in the tests? Have a lovely night! Alex On Sun, Oct 13, 2024 at 11:56:55PM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Fri, Oct 11, 2024 at

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-15 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 09:11:52PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > Every little bit adds up. Documentation is simpler if there is naming > > consistency. We have SYNOPSISes in the man pages, and they're up

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
On Wed, Oct 09, 2024 at 09:11:52PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > Every little bit adds up. Documentation is simpler if there is naming > > consistency. We have SYNOPSISes in the man pages, and they're up front, > &g

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 07:31:50PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > The documentation of an API starts by its prototype. > > > > void login_prompt(char *name, int len); > > void login_prompt(char

Re: Meaning of "length", "size", and "count"

2024-10-09 Thread Alejandro Colomar
Hi Jakub, On Wed, Oct 09, 2024 at 09:40:11PM GMT, Jakub Łukasiewicz wrote: > On 2024-10-09 20:48 CEST, Alejandro Colomar wrote: > > countof() is a new term, so it doesn't yet have a meaning (except as > > given by the attribute), but it naturally fits more with number of &g

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 05:05:16PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > I'm not fabricating, BTW. Here's a list of off-by-one bugs in login > > code, precisely due to this size-length naming issue: > > <h

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Alejandro Colomar
Hi Joseph, On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > wait for them to be reviewed so that we only have a single-patch series, > before doing final review of the main patch. I do not fully understand.

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 02:04:39AM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > > wait for them to be reviewed so that we only

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 03:40:53PM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 03:28:29PM +0200, Alejandro Colomar wrote: > > On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > > > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > > > >

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Joseph, On Tue, Oct 08, 2024 at 02:04:12PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > If you wish to wait for Graz to make sure there's no incompatibility > > with ISO, that's another possibility. > > The name could be c

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Joseph, On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll

[PATCH v14 0/4] c: Add __countof__ operator

2024-10-08 Thread Alejandro Colomar
oposing countof(). This proposal uses double underscores because C2y is too far, and even if we used the same name as WG14 wants, we would prefer to have a name that is under our control, in case WG14 changes anything before the release of C2y. Have a lovely day! Alex Aleja

[PATCH v14 4/4] c: Add __countof__ operator

2024-10-08 Thread Alejandro Colomar
mpas Cc: JeanHeyd Meneide Cc: Fernando Borretti Cc: Jonathan Protzenko Cc: Chris Bazley Cc: Ville Voutilainen Cc: Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Suggested-by: Xavier Del Campo Romero Co-authored-by: Martin Uecker Signed-off-by: Alejandr

[PATCH v14 3/4] Merge definitions of array_type_nelts_top()

2024-10-08 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc

[PATCH v14 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-08 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
[CC -= Jens] Hi Chris, On Tue, Oct 08, 2024 at 03:13:11PM GMT, Chris Bazley wrote: > > ​Because I don't like the paper that has been voted into the standard. > > I kind of presented that paper against my will. I wish GCC merged the > > feature with a different name, and forced the standard to re

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
[CC -= Jens] Hi Joseph, On Tue, Oct 08, 2024 at 03:13:19PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > I have plenty of concerns with > > > both the wording and incompatibility of various changes suggested there > > > rela

[PATCH 0/5] Provide better definitions of NULL

2024-10-11 Thread Alejandro Colomar
/software.codidact.com/posts/292718> Have a lovely day! Alex Alejandro Colomar (5): gcc/ginclude/stddef.h: Indent nested cpp conditionals gcc/ginclude/stddef.h: Invert conditional gcc/ginclude/stddef.h: Define NULL as nullptr if possible Don't define NULL as 0 in C libgm2/libm2

[PATCH 1/5] gcc/ginclude/stddef.h: Indent nested cpp conditionals

2024-10-11 Thread Alejandro Colomar
This is in preparation for the following commits. Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 349213108ce..f2c4f28673c 100644 --- a/gcc

[PATCH 4/5] Don't define NULL as 0 in C

2024-10-11 Thread Alejandro Colomar
That was insane. Link: <https://software.codidact.com/posts/292718> Signed-off-by: Alejandro Colomar --- gcc/testsuite/gcc.c-torture/execute/pr68143_1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/pr70566.c | 2 +- gcc/testsuite/gcc.dg/tm/20100615.c | 2 +- gcc/tes

[PATCH 2/5] gcc/ginclude/stddef.h: Invert conditional

2024-10-11 Thread Alejandro Colomar
This is in preparation for the following commit. Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index f2c4f28673c..4d04b0163d5 100644 --- a/gcc/ginclude/stddef.h

[PATCH 5/5] libgm2/libm2pim/wrapc.cc: Define NULL as nullptr

2024-10-11 Thread Alejandro Colomar
For internal C++ code, unconditionally define NULL as nullptr. We already require a C++11 compiler to bootstrap GCC anyway. Link: <https://software.codidact.com/posts/292718> Signed-off-by: Alejandro Colomar --- libgm2/libm2pim/wrapc.cc | 4 +--- 1 file changed, 1 insertion(+), 3 del

[PATCH 3/5] gcc/ginclude/stddef.h: Define NULL as nullptr if possible

2024-10-11 Thread Alejandro Colomar
0 is a terrible definition of NULL. If possible, that is, for C++11 or later, define is as nullptr. Link: <https://software.codidact.com/posts/292718> Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-02 Thread Alejandro Colomar
the semantic changes of the operator as I implemented them in v12. Changes since v12: - Rename s/__nelementsof__/__lengthof__/ - Fix typo in documentation. Below is a range diff against v12. Have a lovely day! Alex Alejandro Colomar (4): contrib/: Add support for Cc: and Link: tags gcc

[PATCH v13 4/4] c: Add __lengthof__ operator

2024-10-02 Thread Alejandro Colomar
e Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Suggested-by: Xavier Del Campo Romero Co-authored-by: Martin Uecker Signed-off-by: Alejandro Colomar --- gcc/c-family/c-common.cc | 26 gcc/c-family/c-common.def | 3 + gcc/c-family/c-commo

[PATCH v13 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-02 Thread Alejandro Colomar
gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Cc: Gabriel Ravier Cc: Martin Uecker Cc: Joseph Myers Cc: Xavier Del Campo Romero Cc: Jakub Jelinek Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar

[PATCH v13 3/4] Merge definitions of array_type_nelts_top()

2024-10-02 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc

[PATCH v13 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-02 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH v12 0/4] c: Add __nelementsof__ operator

2024-10-02 Thread Alejandro Colomar
Hi! On Sat, Aug 31, 2024 at 04:56:28PM GMT, Alejandro Colomar wrote: > Hi! > > v12 changes: > > - Fix typo in changelog entry. > > For ISO C2y, I'm proposing either nelementsof() or a contracted version > of that name. However, since in GCC we want an uglified n

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
On Wed, Oct 16, 2024 at 10:34:21AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consistency. >

Re: [PATCH v15 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 10:30:36AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > + if (type_code != ARRAY_TYPE) > > +{ > > + error_at (loc, "invalid application of % to type %qT", > >

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 10:34:21AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consistency

[PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Cc: Gabriel Ravier Cc: Martin Uecker Cc: Joseph Myers Cc: Xavier Del Campo Romero Cc: Jakub Jelinek Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar

[PATCH v15 3/4] Merge definitions of array_type_nelts_top()

2024-10-16 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc

[PATCH v15 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-16 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

[PATCH v15 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
Cc: Ville Voutilainen Cc: Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Cc: "Gustavo A. R. Silva" Cc: Patrizia Kaye Cc: Ori Bernstein Cc: Robert Seacord Cc: Marek Polacek Cc: Sam James Signed-off-by: Alejandro Colomar --- gcc/c-family/c-common.cc

[PATCH v15 0/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
he Democratic presidential candidate, ?Every thinking person in America > will vote for you.? Stevenson supposed replied, "That's not enough. > I need a majority.? > > 'Twas always thus. > I would go with __countof__(). It'

[PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-16 Thread Alejandro Colomar
* backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts => array_type_nelts_minus_one Cc: Gabriel Ravier Cc: Martin Uecker Cc: Joseph Myers Cc: Xavier Del Campo Romero Cc: Jakub Jelinek Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar --- gcc/c/c-decl.

[PATCH v1] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-16 Thread Alejandro Colomar
@ will receive the patch. contrib/ChangeLog: * gcc-git-customization.sh: Configure git-format-patch(1) to add 'To: gcc-patches@gcc.gnu.org'. Signed-off-by: Alejandro Colomar --- contrib/gcc-git-customization.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contr

[PATCH v16b 0/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
is a resend, since I accidentally didn't send them to the mailing list. Have a lovely day! Alex Alejandro Colomar (4): contrib/: Add support for Cc: and Link: tags gcc/: Rename array_type_nelts => array_type_nelts_minus_one gcc/: Merge definitions of array_type_nelts_top c: Add __c

[PATCH v16b 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
Cc: Ville Voutilainen Cc: Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Cc: "Gustavo A. R. Silva" Cc: Patrizia Kaye Cc: Ori Bernstein Cc: Robert Seacord Cc: Marek Polacek Cc: Sam James Cc: Richard Biener Signed-off-by: Alejandro Colomar ---

[PATCH v16b 3/4] gcc/: Merge definitions of array_type_nelts_top

2024-10-16 Thread Alejandro Colomar
geLog: * backend/rust-tree.h (array_type_nelts_top) * backend/rust-tree.cc (array_type_nelts_top): Remove function. Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h | 1 - gcc/cp/tree.cc| 13 - gcc/rust/backend/rust-tree.cc

[PATCH v16b 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-16 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-18 Thread Alejandro Colomar
On Fri, Oct 18, 2024 at 10:25:59AM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Wed, Oct 16, 2024 at 08:02:05PM GMT, Alejandro Colomar wrote: > > Hi Joseph, > > > > On Wed, Oct 16, 2024 at 05:21:39PM GMT, Joseph Myers wrote: > > > On Wed,

Re: [PATCH v1] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-16 Thread Alejandro Colomar
On Wed, Oct 16, 2024 at 03:41:00PM GMT, Eric Gallager wrote: > On Wed, Oct 16, 2024 at 8:55 AM Alejandro Colomar wrote: > > > > Just like we already do for git-send-email(1). In some cases, patches > > are prepared with git-format-patch(1), but are sent with a different

Re: [PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 05:21:39PM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consiste

Re: [PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-18 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 08:02:05PM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Wed, Oct 16, 2024 at 05:21:39PM GMT, Joseph Myers wrote: > > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > > > The old name was misleading. > > > > &

[PATCH v14 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-08 Thread Alejandro Colomar
gcc/rust/ChangeLog: * backend/rust-tree.cc (array_type_nelts_top): Rename array_type_nelts() => array_type_nelts_minus_one() Cc: Gabriel Ravier Cc: Martin Uecker Cc: Joseph Myers Cc: Xavier Del Campo Romero Cc: Jakub Jelinek Suggested-by: Richard Biener Signed-off-by: Alejandro Colomar

[PATCH v17 0/2] c: Add __countof__ operator

2024-10-22 Thread Alejandro Colomar
ts. Below is the range diff against v16b. Have a lovely night! Alex Alejandro Colomar (2): contrib/: Add support for Cc: and Link: tags c: Add __countof__ operator contrib/gcc-changelog/git_commit.py| 5 +- gcc/c-family/c-common.cc | 26 + gcc/c-family/c-

Re: [PATCH v17 0/2] c: Add __countof__ operator

2024-10-22 Thread Alejandro Colomar
On Tue, Oct 22, 2024 at 08:48:10PM GMT, Alejandro Colomar wrote: > Hi Joseph, > > I found some tests that could be improved, so I've worked on that in the > last few days. I'll post as a reply to this email the bootstrap and > regression testing results. alx@debian:~

[PATCH v17 2/2] c: Add __countof__ operator

2024-10-22 Thread Alejandro Colomar
Cc: Ville Voutilainen Cc: Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Cc: "Gustavo A. R. Silva" Cc: Patrizia Kaye Cc: Ori Bernstein Cc: Robert Seacord Cc: Marek Polacek Cc: Sam James Cc: Richard Biener Signed-off-by: Alejandro Colomar ---

[PATCH v17 1/2] contrib/: Add support for Cc: and Link: tags

2024-10-22 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH 4/5] Don't define NULL as 0 in C

2024-10-11 Thread Alejandro Colomar
Hi Joseph, On Fri, Oct 11, 2024 at 02:59:50PM GMT, Joseph Myers wrote: > On Fri, 11 Oct 2024, Alejandro Colomar wrote: > > > That was insane. > > Also please avoid such pejorative language in commit messages. The > libiberty code here is 30-40 years (or more) old; the def

Re: [PATCH 4/5] Don't define NULL as 0 in C

2024-10-11 Thread Alejandro Colomar
On Fri, Oct 11, 2024 at 02:55:38PM GMT, Joseph Myers wrote: > On Fri, 11 Oct 2024, Alejandro Colomar wrote: > > > That was insane. > > > > Link: <https://software.codidact.com/posts/292718> > > Signed-off-by: Alejandro Colomar > > --- > > gcc

Re: [PATCH v2] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-11-13 Thread Alejandro Colomar
Hi Eric, On Thu, Oct 17, 2024 at 03:20:11PM GMT, Eric Gallager wrote: > On Thu, Oct 17, 2024 at 10:54 AM Alejandro Colomar wrote: > > > > Just like we already do for git-send-email(1). In some cases, patches > > are prepared with git-format-patch(1), but are sent with a

[PATCH v18 1/2] contrib/: Add support for Cc: and Link: tags

2024-11-10 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

[PATCH v18 0/2] c: Add __countof__ operator

2024-11-10 Thread Alejandro Colomar
reply to this email with the regression-test session results; they all passed. [0] works like a charm. Have a lovely day! Alex Alejandro Colomar (2): contrib/: Add support for Cc: and Link: tags c: Add __countof__ operator contrib/gcc-changelog/git_commit.py| 5 +- gcc/c

[PATCH v18 2/2] c: Add __countof__ operator

2024-11-10 Thread Alejandro Colomar
Alex Celeste Cc: Jakub Łukasiewicz Cc: Douglas McIlroy Cc: Jason Merrill Cc: "Gustavo A. R. Silva" Cc: Patrizia Kaye Cc: Ori Bernstein Cc: Robert Seacord Cc: Marek Polacek Cc: Sam James Cc: Richard Biener Signed-off-by: Alejandro Colomar --- gcc/c-family/c-common.cc

Re: [PATCH v18 0/2] c: Add __countof__ operator

2024-11-10 Thread Alejandro Colomar
On Sun, Nov 10, 2024 at 11:32:54AM GMT, Alejandro Colomar wrote: > Hi! > > Your favourite operator with the most controversial name comes back with > support for [0], thanks to Martin Uecker. In movie theaters, and > probably in GCC 16. > > For those who fight in a side in

Re: [PATCH v17 2/2] c: Add __countof__ operator

2024-10-25 Thread Alejandro Colomar
Hi Joseph, On Fri, Oct 25, 2024 at 08:44:15PM GMT, Joseph Myers wrote: > I don't see the use of pedwarn_c23 and associated tests (error with > -std=c23 -pedantic-errors, warning with -std=c23 -pedantic, no diagnostic > with -std=c23 -pedantic-errors -Wno-c23-c2y-compat, no diagnostic with > -st

Re: [PATCH v2] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-17 Thread Alejandro Colomar
On Thu, Oct 17, 2024 at 04:54:04PM GMT, Alejandro Colomar wrote: > Just like we already do for git-send-email(1). In some cases, patches > are prepared with git-format-patch(1), but are sent with a different > program, or some flags to git-send-email(1) may accidentally in

[PATCH v2] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-17 Thread Alejandro Colomar
@ will receive the patch. contrib/ChangeLog: * gcc-git-customization.sh: Configure git-format-patch(1) to add 'To: gcc-patches@gcc.gnu.org'. Cc: Eric Gallager Signed-off-by: Alejandro Colomar --- Hi! v2 changes: - Fix comment. [Eric] Cheers, Alex Range-diff aga

Re: [PATCH v17 2/2] c: Add __countof__ operator

2024-11-08 Thread Alejandro Colomar
Hi Joseph, This is a gentle ping about this patch set, 10 days before the start of stage 3. Have a lovely day! Alex On Sat, Oct 26, 2024 at 12:10:56AM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Fri, Oct 25, 2024 at 08:44:15PM GMT, Joseph Myers wrote: > > I don&#

Re: [PATCH v2] c: add Wzero-as-null-pointer-constant [PR117059]

2024-11-09 Thread Alejandro Colomar
geLog: > * gcc.dg/Wzero-as-null-pointer-constant.c: New test. > > > Suggested-by: Alejandro Colomar > Acked-by: Alejandro Colomar > > > diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt > index 9b9f5e744f6..b4e967ce000 100644 > --- a/gcc/c-fami

<    1   2   3   4   >