bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new *z*printf-gnu modules


From: Bruno Haible
Subject: Re: new *z*printf-gnu modules
Date: Wed, 26 Jun 2024 00:49:45 +0200

Hi Collin,

> Is the correct way to use them as Paul mentioned previously?
> Like this [1]:
> 
> 
>     #undef printf
>     #define printf zprintf

This is more hairy than you might think. Because of the GCC attribute syntax.

stdio.in.h does

/* Don't break __attribute__((format(printf,M,N))).  */
#    define printf __printf__

because there are not many symbols that can be used in place of 'printf'.

Do you have an idea for doing this nicely? Perhaps another kind of redirect?
A 'static inline' function would not be good, because it cannot be used
everywhere (ISO C 23 ยง 6.7.4.(3)). Maybe an 'extern inline'? Or can __asm__
based redirection made portable across all systems?

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]