From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3A47C433EF for ; Tue, 1 Mar 2022 19:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234402AbiCATXs (ORCPT ); Tue, 1 Mar 2022 14:23:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiCATXq (ORCPT ); Tue, 1 Mar 2022 14:23:46 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18BC3140CC for ; Tue, 1 Mar 2022 11:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V7cO4Vt0cqwoaFpMPaL/vt8fgnm5Csm52tiUXCCqF1k=; b=pQo8E+ASPNjC9fWdI74CITZ4X5 z8Ucp18NfeCkRJlhdwusTjtRF89LYP6qjuUYOzOAL/jS73Hr2BVkVirE8kKU9Deek9ExozWp7FQS8 TqzaZfdaJjzsfH5OPpthFaANK4qHhX8fkfJIq1UlzONXJEIrQmslkqqxACkNMg2Xp49If1BH9x303 XJgX8c0jID0aZDzCbT2J+Qz/wHmwwzxS164ajmAE4UIw6MCTF01cem8ZaAHI/12ujnu/HRvZ3ZvjZ p2BsPERIsgFVC7i0tCNb1fws6bgVpkKKvuYUN05HBIyyHnorpeM43E03otmCyKD1A4u6sGDXLDMw7 MbUZ1MXg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP858-009s4B-JU; Tue, 01 Mar 2022 19:22:46 +0000 Date: Tue, 1 Mar 2022 19:22:46 +0000 From: Matthew Wilcox To: Andrew Morton Cc: kernel test robot , Maninder Singh , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Johannes Weiner , Vaneet Narang , Linux Memory Management List , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , John Ogness Subject: Re: [hnaz-mm:master 272/379] lib/vsprintf.c:991:13: warning: variable 'modbuildid' set but not used Message-ID: References: <202203012040.uFWGm3My-lkp@intel.com> <20220301102448.ff9bf910213d705842a2dd45@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301102448.ff9bf910213d705842a2dd45@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 10:24:48AM -0800, Andrew Morton wrote: > > lib/vsprintf.c: In function 'va_format': > > lib/vsprintf.c:1759:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] > > 1759 | buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); > > | ^~~ > > I wonder what this means. It means the compiler thinks we might want to add: __attribute__((format(gnu_printf, x, y))) to the function declaration so it can type-check the arguments. 'format (ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)' The 'format' attribute specifies that a function takes 'printf', 'scanf', 'strftime' or 'strfmon' style arguments that should be type-checked against a format string. For example, the declaration: extern int my_printf (void *my_object, const char *my_format, ...) __attribute__ ((format (printf, 2, 3))); causes the compiler to check the arguments in calls to 'my_printf' for consistency with the 'printf' style format string argument 'my_format'. I haven't looked into this at all and have no idea if we should.