From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94602 invoked by alias); 7 Jan 2019 15:57:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 94512 invoked by uid 89); 7 Jan 2019 15:56:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1152 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Jan 2019 15:56:58 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65B7A3680F; Mon, 7 Jan 2019 15:56:56 +0000 (UTC) Received: from localhost (unknown [10.33.36.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8B6965332; Mon, 7 Jan 2019 15:56:55 +0000 (UTC) Date: Mon, 07 Jan 2019 15:57:00 -0000 From: Jonathan Wakely To: Nicholas Krause Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Use proper print formatter in main function in fixincl.c Message-ID: <20190107155655.GA9159@redhat.com> References: <20181220222353.16951-1-xerofoify@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181220222353.16951-1-xerofoify@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-01/txt/msg00316.txt.bz2 On 20/12/18 17:23 -0500, Nicholas Krause wrote: >This fixes the bug id, 71176 to use the proper known >code print formatter type, %lu for size_t rather than >%d which is considered best pratice for print statements. Well the proper specifier for size_t is %zu, but since you cast to unsigned long then %lu is right. >Signed-off-by: Nicholas Krause >--- > fixincludes/fixincl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c >index 6dba2f6e830..5b8b77a77f0 100644 >--- a/fixincludes/fixincl.c >+++ b/fixincludes/fixincl.c >@@ -158,11 +158,11 @@ main (int argc, char** argv) > if (VLEVEL( VERB_PROGRESS )) { > tSCC zFmt[] = > "\ >-Processed %5d files containing %d bytes \n\ >+Processed %5d files containing %lu bytes \n\ > Applying %5d fixes to %d files\n\ > Altering %5d of them\n"; > >- fprintf (stderr, zFmt, process_ct, ttl_data_size, apply_ct, >+ fprintf (stderr, zFmt, process_ct, (unsigned int long) ttl_data_size, apply_ct, I'd expect "unsigned long" not "unsigned int long".