Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Apr 2023 19:54:41 -0700
From:      Rick Macklem <rick.macklem@gmail.com>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        Kirk McKusick <mckusick@freebsd.org>,  "src-committers@freebsd.org" <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: 6995e6b3237e - main - Fix printf format conflict
Message-ID:  <CAM5tNy7kAtf=REiO8LCQeU61_-v6tL900cK3LRatbdRBOWo1Zw@mail.gmail.com>
In-Reply-To: <A4438155-DEC9-4524-BD64-54101FAE49B8@freebsd.org>
References:  <202304300055.33U0txC4076743@gitrepo.freebsd.org> <A4438155-DEC9-4524-BD64-54101FAE49B8@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 29, 2023 at 7:17=E2=80=AFPM Jessica Clarke <jrtc27@freebsd.org>=
 wrote:
>
> CAUTION: This email originated from outside of the University of Guelph. =
Do not click links or open attachments unless you recognize the sender and =
know the content is safe. If in doubt, forward suspicious emails to IThelp@=
uoguelph.ca.
>
>
> On 30 Apr 2023, at 01:55, Kirk McKusick <mckusick@FreeBSD.org> wrote:
> >
> > The branch main has been updated by mckusick:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3D6995e6b3237e9be9ae6f68af=
13edd3db4b668ab8
> >
> > commit 6995e6b3237e9be9ae6f68af13edd3db4b668ab8
> > Author:     Kirk McKusick <mckusick@FreeBSD.org>
> > AuthorDate: 2023-04-30 00:55:15 +0000
> > Commit:     Kirk McKusick <mckusick@FreeBSD.org>
> > CommitDate: 2023-04-30 00:55:15 +0000
> >
> >    Fix printf format conflict
> >
> >    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 01b475a03fea..743734660e57 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%jd\tCGSIZE\t%jd\n",
> > +     printf("old_cpg\t%d\tsize_cg\t%d\tCGSIZE\t%d\n",
> >           afs.fs_old_cpg, sizeof(struct cg), CGSIZE(&afs));
>
> size_t is not an int on 64-bit architectures; you want %zu.
Since size_t is 32 bits on some arches, don't you need to use %ju
and (uintmax_t)sizeof(struct cg)?

rick

>
> Jess
>
> >       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);
>
>



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