Implement C23 const-preserving standard library macros

Andreas Schwab schwab@linux-m68k.org
Sat Nov 22 12:35:56 GMT 2025


On Nov 22 2025, Andreas Schwab wrote:

> This now breaks the build of binutils:
>
> In file included from /usr/include/features.h:540,
>                  from /usr/include/dlfcn.h:22,
>                  from ../../../gprofng/libcollector/iolib.c:22:
> ../../../gprofng/libcollector/iolib.c: In function ‘is_not_the_log_file’:
> ../../../gprofng/libcollector/iolib.c:898:18: error: expected identifier before ‘_Generic’
>   898 |   if (CALL_UTIL (strstr)(fname, SP_LOG_FILE) == NULL)
>       |                  ^~~~~~
> ../../../gprofng/libcollector/iolib.c:898:7: note: in expansion of macro ‘CALL_UTIL’
>   898 |   if (CALL_UTIL (strstr)(fname, SP_LOG_FILE) == NULL)
>       |       ^~~~~~~~~
> make[5]: *** [Makefile:648: libgp_collector_la-iolib.lo] Error 1
>
> where CALL_UTIL is defined as:
>
> #define CALL_UTIL(x) __collector_util_funcs.x

This can be fixed by this definition:

#define CALL_UTIL(x) (__collector_util_funcs.x)

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Libc-alpha mailing list