On Aug 5, 2024, at 16:59, Alejandro Colomar wrote:
The “counted-by” attribute currently is not in the TYPE system, and
we plan to add it into the TYPE system later through language
standard (or an GCC extension). If that happens, then both the
“sizeof” and the “__lengthof__” operators should
Hi Qing,
On Mon, Aug 05, 2024 at 10:41:43PM GMT, Martin Uecker wrote:
> Am Montag, dem 05.08.2024 um 20:10 + schrieb Qing Zhao:
> > On Aug 5, 2024, at 06:33, Martin Uecker wrote:
> > >
> > > Am Montag, dem 05.08.2024 um 11:50 +0200 schrieb Jakub Jelinek:
> > > > On Mon, Aug 05, 2024 at 11:45
Am Montag, dem 05.08.2024 um 20:10 + schrieb Qing Zhao:
> On Aug 5, 2024, at 06:33, Martin Uecker wrote:
> >
> > Am Montag, dem 05.08.2024 um 11:50 +0200 schrieb Jakub Jelinek:
> > > On Mon, Aug 05, 2024 at 11:45:56AM +0200, Alejandro Colomar wrote:
> > > > [CC += Kees, Qing]
> > > >
> > > >
On Aug 5, 2024, at 06:33, Martin Uecker wrote:
>
> Am Montag, dem 05.08.2024 um 11:50 +0200 schrieb Jakub Jelinek:
>> 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 wr
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
Am Montag, dem 05.08.2024 um 17:27 +0200 schrieb Alejandro Colomar:
> Hi Martin,
>
...
> > But I think you might make it unnecessarily complicated. It
> > should be sufficient to look at the outermost size. You
> > can completely ignore thatever happens There
> > should be three cases if I am n
Hi Martin,
On Mon, Aug 05, 2024 at 03:35:06PM GMT, Martin Uecker wrote:
> > > > > > For incomplete arrays, basically we have the following different
> > > > > > variants for arrays:
> > > > > >
> > > > > > T[ ] incomplete: !TYPE_DOMAIN
> > > > > > T[1] constant size: TYPE_MAX_VALUE == INTEGER_CS
Am Montag, dem 05.08.2024 um 13:59 +0200 schrieb Alejandro Colomar:
> On Mon, Aug 05, 2024 at 01:58:18PM GMT, Alejandro Colomar wrote:
> > On Mon, Aug 05, 2024 at 01:57:35PM GMT, Alejandro Colomar wrote:
> > > On Mon, Aug 05, 2024 at 01:55:50PM GMT, Alejandro Colomar wrote:
> > > > Hi Martin,
> > >
On Mon, Aug 05, 2024 at 01:58:18PM GMT, Alejandro Colomar wrote:
> On Mon, Aug 05, 2024 at 01:57:35PM GMT, Alejandro Colomar wrote:
> > On Mon, Aug 05, 2024 at 01:55:50PM GMT, Alejandro Colomar wrote:
> > > Hi Martin,
> > >
> > > On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> > > >
On Mon, Aug 05, 2024 at 01:57:35PM GMT, Alejandro Colomar wrote:
> On Mon, Aug 05, 2024 at 01:55:50PM GMT, Alejandro Colomar wrote:
> > Hi Martin,
> >
> > On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> > > > BTW, I still don't understand what `if (! TYPE_DOMAIN (type))` means,
> >
On Mon, Aug 05, 2024 at 01:55:50PM GMT, Alejandro Colomar wrote:
> Hi Martin,
>
> On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> > > BTW, I still don't understand what `if (! TYPE_DOMAIN (type))` means,
> > > within array_type_nelts_minus_one(). What code triggers that condition?
Hi Martin,
On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> > BTW, I still don't understand what `if (! TYPE_DOMAIN (type))` means,
> > within array_type_nelts_minus_one(). What code triggers that condition?
> > Am I missing error handling for that? Thanks!
>
> For incomplete arra
Am Montag, dem 05.08.2024 um 11:50 +0200 schrieb Jakub Jelinek:
> 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 wrote:
> > > On Sun, Aug 04, 2024 at 08:02:25PM GMT, Mar
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 wrote:
> > On Sun, Aug 04, 2024 at 08:02:25PM GMT, Martin Uecker wrote:
> > D'oh! I screwed it. I wanted to have written this:
> >
[CC += Kees, Qing]
Hi Joseph,
On Sun, Aug 04, 2024 at 08:34:24PM GMT, Alejandro Colomar wrote:
> On Sun, Aug 04, 2024 at 08:02:25PM GMT, Martin Uecker wrote:
> D'oh! I screwed it. I wanted to have written this:
>
> $ cat star.c
> void foo(char (*a)[3][*], int (*x)[__lengthof__(*a)
Am Sonntag, dem 04.08.2024 um 20:34 +0200 schrieb Alejandro Colomar:
> On Sun, Aug 04, 2024 at 08:02:25PM GMT, Martin Uecker wrote:
> > Hi Alex,
>
> Hi Martin,
>
> > > Is this missing diagnostics?
> > >
> > > $ cat star.c
> > > void foo(char (*a)[3][*], int (*x)[__lengthof__(*a)]);
> > >
On Sun, Aug 04, 2024 at 08:02:25PM GMT, Martin Uecker wrote:
> Hi Alex,
Hi Martin,
> > Is this missing diagnostics?
> >
> > $ cat star.c
> > void foo(char (*a)[3][*], int (*x)[__lengthof__(*a)]);
> > void bar(char (*a)[*][3], int (*x)[__lengthof__(*a)]);
> > void foos(char (*a)[
Hi Alex,
Am Sonntag, dem 04.08.2024 um 19:49 +0200 schrieb Alejandro Colomar:
> Hi Martin,
>
> On Sun, Aug 04, 2024 at 06:43:46PM GMT, Alejandro Colomar wrote:
> > On Sun, Aug 04, 2024 at 06:40:14PM GMT, Alejandro Colomar wrote:
> > > > The last
> > > > case should return a non-constant.
> > >
Hi Martin,
On Sun, Aug 04, 2024 at 06:43:46PM GMT, Alejandro Colomar wrote:
> On Sun, Aug 04, 2024 at 06:40:14PM GMT, Alejandro Colomar wrote:
> > > The last
> > > case should return a non-constant.
> >
> > The last case [*] is only allowed in prototypes. How should we get the
> > non-constant
Hi Alex,
Am Sonntag, dem 04.08.2024 um 18:40 +0200 schrieb Alejandro Colomar:
> Hi Martin,
>
> On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> > Am Sonntag, dem 04.08.2024 um 10:25 +0200 schrieb Alejandro Colomar:
> > > Hi Martin,
> > >
> > > On Sun, Aug 04, 2024 at 07:38:49AM G
On Sun, Aug 04, 2024 at 06:40:14PM GMT, Alejandro Colomar wrote:
> > The last
> > case should return a non-constant.
>
> The last case [*] is only allowed in prototypes. How should we get the
> non-constant value? It's just another way to say [], isn't it?
>
> > If you reuse the sizeof code, i
Hi Martin,
On Sun, Aug 04, 2024 at 11:39:26AM GMT, Martin Uecker wrote:
> Am Sonntag, dem 04.08.2024 um 10:25 +0200 schrieb Alejandro Colomar:
> > Hi Martin,
> >
> > On Sun, Aug 04, 2024 at 07:38:49AM GMT, Martin Uecker wrote:
> > > Am Sonntag, dem 04.08.2024 um 01:17 +0200 schrieb Alejandro Colo
Am Sonntag, dem 04.08.2024 um 10:25 +0200 schrieb Alejandro Colomar:
> Hi Martin,
>
> On Sun, Aug 04, 2024 at 07:38:49AM GMT, Martin Uecker wrote:
> > Am Sonntag, dem 04.08.2024 um 01:17 +0200 schrieb Alejandro Colomar:
> > >
> > > FUTURE DIRECTIONS:
> > >
> > > We could make it work with arra
Hi Martin,
On Sun, Aug 04, 2024 at 07:38:49AM GMT, Martin Uecker wrote:
> Am Sonntag, dem 04.08.2024 um 01:17 +0200 schrieb Alejandro Colomar:
> >
> > FUTURE DIRECTIONS:
> >
> > We could make it work with array parameters to functions, and
> > somehow magically return the length designat
Am Sonntag, dem 04.08.2024 um 01:17 +0200 schrieb Alejandro Colomar:
>
> FUTURE DIRECTIONS:
>
> We could make it work with array parameters to functions, and
> somehow magically return the length designator of the array,
> regardless of it being really a pointer.
And maybe fl
This operator is similar to sizeof() but can only be applied to an
array, and returns its length (number of elements).
TO BE DECIDED BEFORE MERGING:
It would be better to not evaluate the operand if the top-level
array is not a VLA.
FUTURE DIRECTIONS:
We could make it wo
26 matches
Mail list logo