Re: [PATCH v2 03/28] vsprintf: %pf(%p)

From: andriy.shevchenko@xxxxxxxxxxxxxxx
Date: Fri May 20 2022 - 10:17:24 EST


On Fri, May 20, 2022 at 12:49:24AM -0400, Kent Overstreet wrote:
> On Thu, May 19, 2022 at 09:06:24PM +0000, David Laight wrote:

...

> > > The goal is to replace most of our %p format extensions with this
> > > interface, and to move pretty-printers out of the core vsprintf.c code -
> >
> > One advantage of the current scheme is that is reasonably safe
> > and easy to use.
> > Perhaps too many extra formats have been added recently.
> > This all seems like a recipe for disaster with functions being
> > called with the wrong number of parameters
> > (I can't think how you can compile-time check it).
>
> We can't check it at compile time yet, it's true - printf format checking will
> need to be extended. But we're already talking about doing that.

I have heard about GCC plugin, which also may check the %p extension usages.


--
With Best Regards,
Andy Shevchenko