As of eeff8cae, lib/stdcountof.in.h uses a bare typeof:
 110 /* In C, we can use typeof and __builtin_types_compatible_p.  */
 111 /* Work around clang bug
<https://github.com/llvm/llvm-project/issues/143284>.  */
 112 # if _GL_GNUC_PREREQ (3, 1) && ! defined __clang__ /* || defined
__clang__ */
 113 #  define _gl_verify_is_array(...) \
 114     sizeof (struct { unsigned int _gl_verify_error_if_negative :
__builtin_types_compatible_p (typeof (__VA_ARGS__), typeof
(&*(__VA_ARGS__))) ? -1 : 1; })
 115 # else
 116 /* The compiler does not have the necessary built-ins.  */
 117 #  define _gl_verify_is_array(...) 0
 118 # endif
 119 #endif
https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/stdcountof.in.h;h=1422629bf2838af99f342cd9ed021fa8c6afe1b3;hb=eeff8cae#l114

This breaks compiling gnutls with '-std=c99' (tested on Fedora 43 GCC 15.2.1):
  uniwidth/width.c: In function 'uc_width':
  uniwidth/width.c:61:19: error: unknown type name 'typeof'; did you
mean  '__typeof__'?
     61 |   if ((uc >> 9) < countof (nonspacing_table_ind))
        |                   ^~~~~~~

Another place suggesting __typeof__ for portability:
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
What probably made it surface:
https://lists.gnu.org/archive/html/bug-gnulib/2026-03/msg00013.html


Reply via email to