Re: [PATCH v25 1/3] c: Add _Countof operator

2025-05-28 Thread Sam James
Alejandro Colomar writes: > [...] > diff --git a/gcc/testsuite/gcc.dg/countof-vla.c > b/gcc/testsuite/gcc.dg/countof-vla.c > new file mode 100644 > index ..cc225df20689 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/countof-vla.c > @@ -0,0 +1,35 @@ > +/* { dg-do compile } */ > +/* { dg

[PATCH v25 1/3] c: Add _Countof operator

2025-05-21 Thread Alejandro Colomar
This operator is similar to sizeof but can only be applied to an array, and returns its number of elements. FUTURE DIRECTIONS: - We should make it work with array parameters to functions, and somehow magically return the number of elements of the array, regardless of it being really a poin