Sam James <[email protected]> writes: > Paul Eggert <[email protected]> writes: > >> On 2025-11-06 15:56, Sam James wrote: >>> Having actually looked at it, it's now obvious. GCC trunk implements >>> _Countof (PR117025). >> >> So GCC _Countof doesn't return size_t as C2y requires? >> >> What happens when you run the following program? It should exit with >> status 1; is that what happens with you? >> >> #include <stddef.h> >> extern int bounded[10]; >> int >> main () >> { >> return _Generic (_Countof (bounded), size_t: 1, default: 0); >> } >> >> And if the above does exit with status 1, why does the Gnulib test >> fail there? > > It exits 0. We reached the same conclusion: > https://lists.gnu.org/archive/html/bug-gnulib/2025-11/msg00065.html. > > I'll file a GCC bug. Thanks for probing. It's strange because Alejandro > both recently touched these tests in gnulib and also wrote the support > in GCC. He also commented on the PR which added a test in Clang that GCC > fails (this exact behaviour).
For the benefit of the list, this is now https://gcc.gnu.org/PR122591. And of course no action is required on the gnulib or coreutils side. Thanks again.
