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 753A8C433F5 for ; Wed, 2 Mar 2022 09:52:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5DB28D0002; Wed, 2 Mar 2022 04:52:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE6718D0001; Wed, 2 Mar 2022 04:52:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C89AF8D0002; Wed, 2 Mar 2022 04:52:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id B634F8D0001 for ; Wed, 2 Mar 2022 04:52:53 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 501329F304 for ; Wed, 2 Mar 2022 09:52:53 +0000 (UTC) X-FDA: 79198982226.25.9930484 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 9573012000B for ; Wed, 2 Mar 2022 09:52:52 +0000 (UTC) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646214770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HiQwZhLO+V+Li9Vx/L/RByuSq1OOXUO7G6tMy6whFQ0=; b=VjJ7rxcbWgG73klIYAkTGinVMC3bmnh7/4mRK9dyNVmBlyaDNFkCR43qhKPEp8Z1ZgC8dy LcP9w8Vo/Zj3GJhu/tL09rn1AQt23gFYC7hohyh+yNuZk5ogw8vh7N3/ey1aLOca2dzkhe K2OyZjEc/jinADBHIs8sgkMZn4D9Ga+CvfPDSAP22tqPw6RFqouyvSrtvgi3arpGcsNAJV /TsymlCcFSXHmDdYUcqEoW1LPzKWRnk3eejf1X/+SO+apwgr+zc870HMbXD+MkWRzU8aiQ OeshiCCwKxWLuONur0XKloT/xSIAh0ovgv/YSarih4rDFyx/vFAGEPK+DKuVAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646214770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HiQwZhLO+V+Li9Vx/L/RByuSq1OOXUO7G6tMy6whFQ0=; b=l1E3u1waIbN+5wcPD0XM4nTY3Rf+hEiYAYMgq9ynvte4swHlxadupcOlQSv6kteJjX+EbO Uu9h2HxMd6LtOLDg== To: Matthew Wilcox , 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 Subject: Re: [hnaz-mm:master 272/379] lib/vsprintf.c:991:13: warning: variable 'modbuildid' set but not used In-Reply-To: References: <202203012040.uFWGm3My-lkp@intel.com> <20220301102448.ff9bf910213d705842a2dd45@linux-foundation.org> Date: Wed, 02 Mar 2022 10:58:49 +0106 Message-ID: <8735k0isum.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9573012000B X-Stat-Signature: jcnojbc88uwkuxi5hrw48mudkadtpadq Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=VjJ7rxcb; dkim=pass header.d=linutronix.de header.s=2020e header.b=l1E3u1wa; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf29.hostedemail.com: domain of john.ogness@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=john.ogness@linutronix.de X-HE-Tag: 1646214772-963625 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 2022-03-01, Matthew Wilcox 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. AFAICT it is not possible to use the gnu_printf format attribute for this because the va_list to check is a field within the passed in struct pointer @va_fmt. John Ogness