From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.nh2.me (mail.nh2.me [116.202.188.98]) by sourceware.org (Postfix) with ESMTPS id B8AD73858436 for ; Sat, 30 Oct 2021 00:37:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8AD73858436 Subject: Re: [PATCH] malloc_stats(): Fix `unsigned int` overflow To: DJ Delorie Cc: libc-alpha@sourceware.org References: From: =?UTF-8?Q?Niklas_Hamb=c3=bcchen?= Message-ID: Date: Sat, 30 Oct 2021 02:36:58 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_INFOUSMEBIZ, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2021 00:37:04 -0000 The error: > malloc.c:5169:48: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] glibc doesn't require C99, so I guess "%zu" is not an option, right? Since this is just in an `fprintf`, would casting to `(unsigned long long)` and using "%llu" be considered acceptable? Niklas