From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15212 invoked from network); 19 Mar 2021 20:19:51 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 19 Mar 2021 20:19:51 -0000 Received: by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 15ff193f; Fri, 19 Mar 2021 20:19:35 +0000 (UTC) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id b6c4f4a2 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 19 Mar 2021 20:19:33 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 73A901F9FC; Fri, 19 Mar 2021 20:19:31 +0000 (UTC) Date: Fri, 19 Mar 2021 20:19:31 +0000 From: Eric Wong To: cgit@lists.zx2c4.com Subject: [PATCH (resend)] ui-stats.c: fix warning on 32-bit Message-ID: <20210319201931.GA17268@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" gcc 6.3.0-18 on Debian oldstable 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); > ^ Signed-off-by: Eric Wong --- ui-stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-stats.c b/ui-stats.c index 09b3625..ad22dae 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);