Re: [PATCH v20 2/4] c: Add _Countof operator

2025-05-12 Thread Alejandro Colomar
On Mon, May 12, 2025 at 10:54:34AM +, Joseph Myers wrote: > On Sun, 11 May 2025, Alejandro Colomar wrote: > > > +/* { dg-options "-Wno-declaration-after-statement -Wno-pedantic -Wno-vla" > > } */ > > > +/* { dg-options "-Wno-pedantic -Wvla-parameter" } */ > > > +/* { dg-options "-Wno-declar

Re: [PATCH v20 2/4] c: Add _Countof operator

2025-05-12 Thread Joseph Myers
On Sun, 11 May 2025, Alejandro Colomar wrote: > +/* { dg-options "-Wno-declaration-after-statement -Wno-pedantic -Wno-vla" } > */ > +/* { dg-options "-Wno-pedantic -Wvla-parameter" } */ > +/* { dg-options "-Wno-declaration-after-statement -Wno-pedantic -Wno-vla" } > */ Most of these options a

[PATCH v20 2/4] c: Add _Countof operator

2025-05-11 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