All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Jeff King <peff@peff.net>,  Git List <git@vger.kernel.org>,
	 Patrick Steinhardt <ps@pks.im>,
	 Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH] t-strvec: fix type mismatch in check_strvec
Date: Tue, 16 Jul 2024 09:33:25 -0700	[thread overview]
Message-ID: <xmqqbk2x9u0a.fsf@gitster.g> (raw)
In-Reply-To: <1521ed89-989e-452b-b7fc-9e73672e0764@web.de> ("René Scharfe"'s message of "Tue, 16 Jul 2024 18:14:35 +0200")

René Scharfe <l.s.r@web.de> writes:

> Cast i from size_t to uintmax_t to match the format string.
>
> Reported-by: Jeff King <peff@peff.net>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> Oops, sorry about that. :-(
>
> PRIuMAX is "lu" on my system, so the compiler didn't flag the mistake.
>
>  t/unit-tests/t-strvec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

The fix is of course identical to what I added to the integration I
prepared, but the line-wrapping is better in this version, so I'll
replace ;-)

> diff --git a/t/unit-tests/t-strvec.c b/t/unit-tests/t-strvec.c
> index fdb28ba220..fa1a041469 100644
> --- a/t/unit-tests/t-strvec.c
> +++ b/t/unit-tests/t-strvec.c
> @@ -11,7 +11,8 @@
>  		    check_uint((vec)->nr, <=, (vec)->alloc)) { \
>  			for (size_t i = 0; i < ARRAY_SIZE(expect); i++) { \
>  				if (!check_str((vec)->v[i], expect[i])) { \
> -					test_msg("      i: %"PRIuMAX, i); \
> +					test_msg("      i: %"PRIuMAX, \
> +						 (uintmax_t)i); \
>  					break; \
>  				} \
>  			} \
> --
> 2.45.2

      reply	other threads:[~2024-07-16 16:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04 18:04 [PATCH] t-strvec: use test_msg() René Scharfe
2024-07-04 18:31 ` Eric Sunshine
2024-07-05  9:44 ` Phillip Wood
2024-07-05 17:03 ` [PATCH v2] " René Scharfe
2024-07-09 11:32   ` Jeff King
2024-07-14 10:17     ` René Scharfe
2024-07-16  1:43       ` Jeff King
2024-07-16 16:43         ` René Scharfe
2024-07-14 17:06   ` [PATCH v2 2/1] t-strvec: improve check_strvec() output René Scharfe
2024-07-15 14:44     ` Junio C Hamano
2024-07-14 17:06   ` [PATCH v2 3/1] t-strvec: tighten .alloc check in check_strvec René Scharfe
2024-07-15 14:43     ` Junio C Hamano
2024-07-15 16:47       ` René Scharfe
2024-07-15 17:27         ` Junio C Hamano
2024-07-14 10:17 ` [PATCH v3] t-strvec: improve check_strvec() output René Scharfe
2024-07-14 17:06   ` René Scharfe
2024-07-16  4:37   ` Jeff King
2024-07-16 15:20     ` Junio C Hamano
2024-07-16 16:14       ` [PATCH] t-strvec: fix type mismatch in check_strvec René Scharfe
2024-07-16 16:33         ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqbk2x9u0a.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.