Hi Joseph, On Fri, May 16, 2025 at 05:01:36PM +0000, Joseph Myers wrote: > On Fri, 16 May 2025, Alejandro Colomar wrote: > > > Hmmm, I've been trying to find a compromise between readability and > > simplicity, and I think I have something. I've seen some tests that > > define assert() themselves. I like assert(3) because it's more > > readable compared to a conditional plus abort(3). > > > > So, how do you feel about the following change? > > > > diff --git i/gcc/testsuite/gcc.dg/countof-stdcountof.c > > w/gcc/testsuite/gcc.dg/countof-stdcountof.c > > index a7fe4079c69..2fb0c6306ef 100644 > > --- i/gcc/testsuite/gcc.dg/countof-stdcountof.c > > +++ w/gcc/testsuite/gcc.dg/countof-stdcountof.c > > @@ -3,8 +3,7 @@ > > > > #include <stdcountof.h> > > > > -#undef NDEBUG > > -#include <assert.h> > > +#define assert(e) ((e) ? (void) 0 : __builtin_abort ()) > > Yes, I think that's a reasonable way for a test to do its assertions with > assert syntax but without depending unnecessarily on libc headers.
If there are any other issues, I'll apply that change for v23. If this is the only one, would you mind amending yourself with that while committing? Thanks! Cheers, Alex -- <https://www.alejandro-colomar.es/>
signature.asc
Description: PGP signature