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

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 Joseph Myers
On Tue, 6 Aug 2024, Alejandro Colomar wrote: > > Next question for the specification, implementation and tests: how does > > this feature interact with the rules on external definitions (the contexts > > in which it's OK to refer to an identifier with internal or external > > linkage that's nev

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 > >should not be run als

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

2024-08-06 Thread Joseph Myers
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 >should not be run also gives the expected diagnostics. >Can anyone give advice of why it's not runn

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 Qing Zhao
Hi, Alex, 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 thread for each of the new version of the patch? (i.e, Please not reply to the previous version when you have a

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 Martin Uecker
Am Dienstag, dem 06.08.2024 um 16:12 +0200 schrieb 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 th

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) as a normal program. The o

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

2024-08-06 Thread Martin Uecker
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) as a normal program. The one that >should not be run also gives the expected diagnostics. >Can anyone

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 cases that are constant expre

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

2024-08-06 Thread Alejandro Colomar
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 cases that are constant expressions. - Document the evaluation rules, which are unique to this operator (s