Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Apr 2023 03:55:34 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Rick Macklem <rick.macklem@gmail.com>
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:  <164F1299-0F3D-424C-8A76-C0FD8239B31C@freebsd.org>
In-Reply-To: <CAM5tNy7kAtf=REiO8LCQeU61_-v6tL900cK3LRatbdRBOWo1Zw@mail.gmail.com>
References:  <202304300055.33U0txC4076743@gitrepo.freebsd.org> <A4438155-DEC9-4524-BD64-54101FAE49B8@freebsd.org> <CAM5tNy7kAtf=REiO8LCQeU61_-v6tL900cK3LRatbdRBOWo1Zw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30 Apr 2023, at 03:54, Rick Macklem <rick.macklem@gmail.com> wrote:
>=20
> On Sat, Apr 29, 2023 at 7:17=E2=80=AFPM Jessica Clarke =
<jrtc27@freebsd.org> wrote:
>>=20
>> 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.
>>=20
>>=20
>> On 30 Apr 2023, at 01:55, Kirk McKusick <mckusick@FreeBSD.org> wrote:
>>>=20
>>> The branch main has been updated by mckusick:
>>>=20
>>> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D6995e6b3237e9be9ae6f68af13edd3db=
4b668ab8
>>>=20
>>> 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
>>>=20
>>>   Fix printf format conflict
>>>=20
>>>   MFC after:   1 week
>>> ---
>>> sbin/dumpfs/dumpfs.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>=20
>>> 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));
>>=20
>> 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)?

No. %zu is size_t by definition. That=E2=80=99s the point of its =
existence.

Jess

> rick
>=20
>>=20
>> Jess
>>=20
>>>      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?164F1299-0F3D-424C-8A76-C0FD8239B31C>