From mboxrd@z Thu Jan 1 00:00:00 1970 From: e at 80x24.org (Eric Wong) Date: Mon, 31 Dec 2018 10:19:39 +0000 Subject: [PATCH] ui-stats.c: fix warning on 32-bit Message-ID: <20181231101939.GA16677@dcvr> gcc 6.3.0-18 on Debian stable emits the following warning, despite uintptr_t and "unsigned long" having the same size: > ../ui-stats.c: In function ?print_authors?: > ../ui-stats.c:340:18: warning: format ?%lu? expects argument of type ?long unsigned int?, but argument 2 has type ?unsigned int? [-Wformat=] > htmlf("%lu", (uintptr_t)date->util); > ^ --- ui-stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-stats.c b/ui-stats.c index 7acd358..d7c4c97 100644 --- a/ui-stats.c +++ b/ui-stats.c @@ -337,8 +337,10 @@ static void print_authors(struct string_list *authors, int top, if (!date) html("0"); else { - htmlf("%lu", (uintptr_t)date->util); - total += (uintptr_t)date->util; + uintptr_t util = (uintptr_t)date->util; + + htmlf("%"PRIuPTR"", util); + total += util; } } htmlf("%ld", total); -- EW