[cfe-dev] [RFC] new format string attributes

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 25 09:59:17 PDT 2020


On Wed, Mar 25, 2020 at 11:51 AM Marcus Johnson
<marcusljohnson1991 at gmail.com> wrote:
> > That doesn't answer why we need a new format archtype. The archtypes
> > are used because we want the check to model behavior specific to some
> > API. If I understand your proposal properly, you're not proposing to
> > add anything like uprintf() to a C library (and such an API doesn't
> > already exist), so adding a new archtype surprises me. I would have
> > thought the existing archtypes would suffice, but maybe I'm still
> > misunderstanding a part of your proposal.
> >
> > ~Aaron
>
> I'm not against adding printf functions to the C standard, I've got my own formatters that work with UTF-16 and UTF-32 and I just want to add compile time checking to them really.
>
> the point of adding new length modifiers to the standard is so the current functions can accept a UTF-16 or UTF-32 strings or characters as arguments

Ah, I think I may be starting to understand better now, thank you! It
sounds like what you're looking for is a way to add length modifiers
and format specifier extensions for a custom printf-like API, with the
current use case being for UTF-16 and UTF-32 strings. Would that be an
accurate understanding?

~Aaron


More information about the cfe-dev mailing list