Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Apr 2023 07:21:59 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        Kirk McKusick <mckusick@freebsd.org>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>,  "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 2e7797cd9bba - main - Yet another try to fix printf format conflict.
Message-ID:  <CANCZdfrvA_RKX2KPkH=suHdfKT4W6r9YbRbv%2BWoBk2sMcL=U_g@mail.gmail.com>
In-Reply-To: <3ECD7073-5F45-4C62-BE47-D1C8CEC61883@freebsd.org>
References:  <202304300700.33U70cF9082164@gitrepo.freebsd.org> <3ECD7073-5F45-4C62-BE47-D1C8CEC61883@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000001811e605fa8d98c7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Apr 30, 2023, 1:08 AM Jessica Clarke <jrtc27@freebsd.org> wrote:

> On 30 Apr 2023, at 08:00, Kirk McKusick <mckusick@FreeBSD.org> wrote:
> >
> > The branch main has been updated by mckusick:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=3D2e7797cd9bba4fa82391b53a7dd7aac=
074baf716
> >
> > commit 2e7797cd9bba4fa82391b53a7dd7aac074baf716
> > Author:     Kirk McKusick <mckusick@FreeBSD.org>
> > AuthorDate: 2023-04-30 06:59:45 +0000
> > Commit:     Kirk McKusick <mckusick@FreeBSD.org>
> > CommitDate: 2023-04-30 07:00:23 +0000
> >
> >    Yet another try to fix printf format conflict.
> >
> >    I find it very annoying that there is no FreeBSD infrastructure to
> >    determine failures across architectures other than to check in
> >    changes and then have Jenkins find them.
>
> That=E2=80=99s what make universe/tinderbox/worlds/kernels are for? (See =
build(7))
>

There's other ways too. The long way is to 'make buildworld TARGET=3Di386'
which will catch things like this. However, that can take a while... If
you've done one of those in the past, there will be enough of a tree for
the next trick to work:

cd sbin/dumpfs
make buildenv TARGET=3Di386
make     # in a subshell
exit

This will also build things and see if you got the printf formatting right
and is pretty quick.

So of course I always do this before I commit.... the fix that the
tinderbox tells me I broke (since I don't always remember that I've changed
a printf in larger commits). it would be nice if clang had a magic flag to
catch this....

Warner

Jess
>
> >    Suggested by: Jessica Clarke
> >    MFC after:    1 week
> > ---
> > sbin/dumpfs/dumpfs.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c
> > index 743734660e57..a0767c39e6bf 100644
> > --- a/sbin/dumpfs/dumpfs.c
> > +++ b/sbin/dumpfs/dumpfs.c
> > @@ -245,7 +245,7 @@ dumpfs(const char *name, int dosb)
> >       default:
> >               goto err;
> >       }
> > -     printf("old_cpg\t%d\tsize_cg\t%d\tCGSIZE\t%d\n",
> > +     printf("old_cpg\t%d\tsize_cg\t%zu\tCGSIZE\t%zu\n",
> >           afs.fs_old_cpg, sizeof(struct cg), CGSIZE(&afs));
> >       printf("sblkno\t%d\tcblkno\t%d\tiblkno\t%d\tdblkno\t%d\n",
> >           afs.fs_sblkno, afs.fs_cblkno, afs.fs_iblkno, afs.fs_dblkno);
>
>

--0000000000001811e605fa8d98c7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Sun, Apr 30, 2023, 1:08 AM Jessica Clarke &lt;<a hr=
ef=3D"mailto:jrtc27@freebsd.org">jrtc27@freebsd.org</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">On 30 Apr 2023, at 08:00, Kirk McKusick &lt=
;mckusick@FreeBSD.org&gt; wrote:<br>
&gt; <br>
&gt; The branch main has been updated by mckusick:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D2e7797cd9bba=
4fa82391b53a7dd7aac074baf716" rel=3D"noreferrer noreferrer" target=3D"_blan=
k">https://cgit.FreeBSD.org/src/commit/?id=3D2e7797cd9bba4fa82391b53a7dd7aa=
c074baf716</a><br>
&gt; <br>
&gt; commit 2e7797cd9bba4fa82391b53a7dd7aac074baf716<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Kirk McKusick &lt;mckusick@FreeBSD.org&gt;<=
br>
&gt; AuthorDate: 2023-04-30 06:59:45 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Kirk McKusick &lt;mckusick@FreeBSD.org&gt;<=
br>
&gt; CommitDate: 2023-04-30 07:00:23 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Yet another try to fix printf format conflict.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 I find it very annoying that there is no FreeBSD infrastr=
ucture to<br>
&gt;=C2=A0 =C2=A0 determine failures across architectures other than to che=
ck in<br>
&gt;=C2=A0 =C2=A0 changes and then have Jenkins find them.<br>
<br>
That=E2=80=99s what make universe/tinderbox/worlds/kernels are for? (See bu=
ild(7))<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D=
"auto">There&#39;s other ways too. The long way is to &#39;make buildworld =
TARGET=3Di386&#39; which will catch things like this. However, that can tak=
e a while... If you&#39;ve done one of those in the past, there will be eno=
ugh of a tree for the next trick to work:</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">cd sbin/dumpfs</div><div dir=3D"auto">make buildenv TARGE=
T=3Di386</div><div dir=3D"auto">make=C2=A0 =C2=A0 =C2=A0# in a subshell</di=
v><div dir=3D"auto">exit</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>This will also build things and see if you got the printf formatting right=
 and is pretty quick.</div><div dir=3D"auto"><br></div><div dir=3D"auto">So=
 of course I always do this before I commit.... the fix that the tinderbox =
tells me I broke (since I don&#39;t always remember that I&#39;ve changed a=
 printf in larger commits). it would be nice if clang had a magic flag to c=
atch this....</div><div dir=3D"auto"><br></div><div dir=3D"auto">Warner</di=
v><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmail_quote">=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Jess<br>
<br>
&gt;=C2=A0 =C2=A0 Suggested by: Jessica Clarke<br>
&gt;=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 1 week<br>
&gt; ---<br>
&gt; sbin/dumpfs/dumpfs.c | 2 +-<br>
&gt; 1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c<br>
&gt; index 743734660e57..a0767c39e6bf 100644<br>
&gt; --- a/sbin/dumpfs/dumpfs.c<br>
&gt; +++ b/sbin/dumpfs/dumpfs.c<br>
&gt; @@ -245,7 +245,7 @@ dumpfs(const char *name, int dosb)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0default:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto err;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; -=C2=A0 =C2=A0 =C2=A0printf(&quot;old_cpg\t%d\tsize_cg\t%d\tCGSIZE\t%d=
\n&quot;,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0printf(&quot;old_cpg\t%d\tsize_cg\t%zu\tCGSIZE\t%=
zu\n&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0afs.fs_old_cpg, sizeof(struct =
cg), CGSIZE(&amp;afs));<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0printf(&quot;sblkno\t%d\tcblkno\t%d\tiblkno\=
t%d\tdblkno\t%d\n&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0afs.fs_sblkno, afs.fs_cblkno, =
afs.fs_iblkno, afs.fs_dblkno);<br>
<br>
</blockquote></div></div></div>

--0000000000001811e605fa8d98c7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrvA_RKX2KPkH=suHdfKT4W6r9YbRbv%2BWoBk2sMcL=U_g>