[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How does string.format handle undefined behavior?
- From: Halalaluyafail3 <luigighiron@...>
- Date: Wed, 1 Sep 2021 14:18:05 -0400
It seems fine to disallow the '+' and ' ' flags for conversion
specifiers other than d, i, a, A, e, E, f, F, g, and G. If adding a
'+' or ' ' is intended it should put it before '%' ("+%c" instead of
The behavior with repeated flags is also not very well defined,
prohibiting them is probably fine.
On Tue, Aug 31, 2021 at 1:45 PM Roberto Ierusalimschy
> To define a behavior as undefined sounds like those "this page
> intentionally left blank" pages :-)
> In the particular case of 'printf', the format "%#c" is defined as
> undefined, while the format "%+c" is literally undefined. Should we
> consider "%+c" as undefined behavior(™)?
> -- Roberto