Re:Tearing apart printf() (2018)
by lelf on Tuesday November 12, 2019 @07:23PM
(#21519797)
4. On GNU/Linux you can add your own %-conversions (e. g. %Y) with register_printf_function.
[ Parent
| on HN ]
register_printf_function is deprecated; you should use register_printf_specifier instead.
I strongly advise against using either since both are not only non-portable, but also break any compiler support for getting you warnings when you're using it wrong.
The Linux kernel style suffix extensions (cf. https://www.kernel.org/doc/Documentation/printk-formats.txt) are much better on the latter front.