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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C39B2C433F5 for ; Tue, 1 Mar 2022 19:23:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04C6C8D0002; Tue, 1 Mar 2022 14:23:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F16E78D0001; Tue, 1 Mar 2022 14:23:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB7D78D0002; Tue, 1 Mar 2022 14:23:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id C72338D0001 for ; Tue, 1 Mar 2022 14:23:06 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 80137181C49C1 for ; Tue, 1 Mar 2022 19:23:06 +0000 (UTC) X-FDA: 79196790372.22.4FE1B27 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 9AE9C40009 for ; Tue, 1 Mar 2022 19:23:05 +0000 (UTC) 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> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9AE9C40009 X-Stat-Signature: ncdzwerdiuqm5ui83kcdrsk7o771imjw Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pQo8E+AS; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1646162585-968725 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.