Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 2024 17:52:43 +0100
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling
Message-ID:  <CANCZdfo2W0OtDXkMv1EAFGxqoPqSgPXutvHegRGspE3k5W2opQ@mail.gmail.com>
In-Reply-To: <Ztt4XCQtc_MFcM4m@kib.kiev.ua>
References:  <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> <Zttr1UzRKtHz_6o5@kib.kiev.ua> <CANCZdfrrQ0eeHPU9qJdvin-daXphHBbExUiuLe0Wq1t_R0rtPg@mail.gmail.com> <Ztt4XCQtc_MFcM4m@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, Sep 6, 2024 at 10:47 PM Konstantin Belousov <kostikbel@gmail.com>
wrote:

> On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote:
> > On Fri, Sep 6, 2024 at 2:53 PM Konstantin Belousov <kostikbel@gmail.com>
> > wrote:
> >
> > > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote:
> > > > The branch main has been updated by imp:
> > > >
> > > > URL:
> > >
> https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> > > >
> > > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> > > > Author:     Sebastian Huber <sebastian.huber@embedded-brains.de>
> > > > AuthorDate: 2024-06-14 07:30:28 +0000
> > > > Commit:     Warner Losh <imp@FreeBSD.org>
> > > > CommitDate: 2024-09-06 18:34:30 +0000
> > > >
> > > >     kvprintf(): Fix '+' conversion handling
> > > >
> > > >     For example, printf("%+i", 1) prints "+1".  However, kvprintf()
> did
> > > >     print just "1" for this example.  According to PRINTF(3):
> > > >
> > > >       A sign must always be placed before a number produced by a
> signed
> > > >       conversion.
> > > >
> > > >     For "%+r" radix conversions, keep the "+" handling as it is,
> since
> > > this
> > > >     is a non-standard conversion.  For "%+p" pointer conversions,
> > > continue
> > > >     to ignore the sign modifier to be in line with libc.
> > > >
> > > >     This change allows to support the ' conversion modifier in the
> > > future.
> > > >
> > > >     Reviewed by: imp
> > > >     Pull Request: https://github.com/freebsd/freebsd-src/pull/1310
> > > > ---
> > > >  sys/kern/subr_prf.c | 27 +++++++++++++--------------
> > > >  1 file changed, 13 insertions(+), 14 deletions(-)
> > > Again, isn't rtld_printf needs the same change?
> > >
> >
> > This time I don't think so. I'll double check though. I'd checked when
> this
> > came in. Thanks for the reminder.
> It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c.
>

Yes. It's required. I've updated and committed. Thanks again for the
reminder.
I must have been confused when I thought it wasn't needed, since it isn't
even
a close call looking at it just now.

Warner

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 6, 2024 at 10:47 PM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com">kostikbel@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote:<br>
&gt; On Fri, Sep 6, 2024 at 2:53 PM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com" target="_blank">kostikbel@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt; <br>
&gt; &gt; On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote:<br>
&gt; &gt; &gt; The branch main has been updated by imp:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; URL:<br>
&gt; &gt; <a href="https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad</a><br>;
&gt; &gt; &gt;<br>
&gt; &gt; &gt; commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad<br>
&gt; &gt; &gt; Author:     Sebastian Huber &lt;<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>&gt;<br>
&gt; &gt; &gt; AuthorDate: 2024-06-14 07:30:28 +0000<br>
&gt; &gt; &gt; Commit:     Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; &gt; &gt; CommitDate: 2024-09-06 18:34:30 +0000<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     kvprintf(): Fix &#39;+&#39; conversion handling<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     For example, printf(&quot;%+i&quot;, 1) prints &quot;+1&quot;.  However, kvprintf() did<br>
&gt; &gt; &gt;     print just &quot;1&quot; for this example.  According to PRINTF(3):<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;       A sign must always be placed before a number produced by a signed<br>
&gt; &gt; &gt;       conversion.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     For &quot;%+r&quot; radix conversions, keep the &quot;+&quot; handling as it is, since<br>
&gt; &gt; this<br>
&gt; &gt; &gt;     is a non-standard conversion.  For &quot;%+p&quot; pointer conversions,<br>
&gt; &gt; continue<br>
&gt; &gt; &gt;     to ignore the sign modifier to be in line with libc.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     This change allows to support the &#39; conversion modifier in the<br>
&gt; &gt; future.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     Reviewed by: imp<br>
&gt; &gt; &gt;     Pull Request: <a href="https://github.com/freebsd/freebsd-src/pull/1310" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd-src/pull/1310</a><br>;
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;  sys/kern/subr_prf.c | 27 +++++++++++++--------------<br>
&gt; &gt; &gt;  1 file changed, 13 insertions(+), 14 deletions(-)<br>
&gt; &gt; Again, isn&#39;t rtld_printf needs the same change?<br>
&gt; &gt;<br>
&gt; <br>
&gt; This time I don&#39;t think so. I&#39;ll double check though. I&#39;d checked when this<br>
&gt; came in. Thanks for the reminder.<br>
It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c.<br></blockquote><div><br></div><div>Yes. It&#39;s required. I&#39;ve updated and committed. Thanks again for the reminder.</div><div>I must have been confused when I thought it wasn&#39;t needed, since it isn&#39;t even</div><div>a close call looking at it just now.</div><div><br></div><div>Warner </div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfo2W0OtDXkMv1EAFGxqoPqSgPXutvHegRGspE3k5W2opQ>