From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED5FA32D7C7 for ; Mon, 23 Mar 2026 10:54:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774263269; cv=none; b=HNzHqrQGK0JV8yEJ9DT1+R3PTeVq84OWRR78koCeb9Rpy4YT+gh040u+x3ziWKNT7oZqKVxtHTByfhIAI5V+ISIXJ0DsGSdkUf3homyjRTwSFaY7wUJvqMe3iMrSbtjI6mGGW091lbxQLyIO/gTETKrcaZElJfpkldRoUFTpo60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774263269; c=relaxed/simple; bh=dCNJE7U5RGNCFs1f/bIjCmMUBMSVOy/fPu+d8fLBcQg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=btLg4NT7NXWA/GFF93YaXPw9XJWWS0pa/uNFDHo/Q4+QTxKQcXS4xNElrRLCjoeI6AP90DSMg1M49Z7YavdG/VE0jZ+iMXY3wz+soDVUaRwXUQvhDKfZK7p/MRyzzbAKWY7JGNRtTI18S2UR56kCFmnMZZwxqFpX7RHQ3bzdu34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=na+ZZ53r; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="na+ZZ53r" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-486f89b7f69so28919045e9.0 for ; Mon, 23 Mar 2026 03:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774263266; x=1774868066; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2kszuLAyxs0b0uA7vliUMXaWBAHNPS94Epw+3Op512A=; b=na+ZZ53r4apOGKI4R+E7NFuWMvSUVWYwJ40jeQMygKXFSUWNmXzVaGUjmGR3y77YwT IB+97IEixBYdWRQc2HMp1HNLxagxei++g3+VRWmajarwH0Dm9BYcxnVyuOBgxSScQEhj yIxYqcsA8yk0ThHYRaMXaNh8eLWH0aaequU1aNvbyPWfqofdicGgOTSzAwDlHIbtoqTu s+r53f/bjVesNBAbXNaM9JH2bT0VQPrEjJNOstj0Sai2439+2z73XU12DSAfbKDcE9r1 4BRzwhkbRtNC2rNhyT2VZtCiPmDDxaqnytQ12vGFSEHIvH39BBTbn9RZ89d+7HnSo302 MA9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774263266; x=1774868066; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2kszuLAyxs0b0uA7vliUMXaWBAHNPS94Epw+3Op512A=; b=KIpFKk+3IK9esEvHOF6YgQsiFmOXQh6fY9t8Qo0Z6QgWzBNWQMk+nZXjQepfdtS/Pm eHX1V2j8/YzmzB/scvPkj9y1Mc34I4JQT6T66M/9X10MfPIAlsS1VDkxCBioHnf4J2jl dRCfAXyBW4nAgHq8BSyiDipXeOJQSxWdoZF3iuElIUyjMEJMu/aw6lgETDjEXWynNgGE xS4CO5vDT1G+vySfk4V1BQrJSybnD4uKhEIDxqMPt4xbm2YJ0s3LNaIW+36+dEXpLMQO 5S7HhBUnUhL0lvHI7sKdPeFrxeoNEtP4BKSz0FU4Ke4x2WZ3OvrsZZoyy07zQuJuS98b BwBw== X-Forwarded-Encrypted: i=1; AJvYcCVb+6mDnSVb7hOQ0NNvmNaJ9wYXAsSk8mgOfMDUJza1u+EmxcIBdvwttpwy0vr0eQjevkZCbjS58TRsWpc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx27qpwT4n2zWKD/SzK1lEedkaxvZlgqxEV7EQOc0GuRpti9C8p MoGDsHpV2deOb8L7TOBJsRoHAWPeIJ3Cc8tM11gB/MCaYIkT0wyy6YwJLt/k0OKTgcopN/mPDIG K3n5HNQ6pnucXZg== X-Received: from wruq7.prod.google.com ([2002:a5d:6587:0:b0:43b:4e01:4ab8]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3056:b0:487:1fc:14f9 with SMTP id 5b1f17b1804b1-48701fc15bbmr75448495e9.15.1774263266307; Mon, 23 Mar 2026 03:54:26 -0700 (PDT) Date: Mon, 23 Mar 2026 10:54:25 +0000 In-Reply-To: <20260320211528.2474389-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260320211528.2474389-1-arnd@kernel.org> X-Mailer: aerc 0.21.0 Message-ID: Subject: Re: [PATCH] bug: shut up format attribute warning for clang as well From: Brendan Jackman To: Arnd Bergmann , Andrew Morton , Nathan Chancellor , "Peter Zijlstra (Intel)" , Ingo Molnar , Brendan Jackman Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , , Content-Type: text/plain; charset="UTF-8" On Fri Mar 20, 2026 at 9:14 PM UTC, Arnd Bergmann wrote: > From: Arnd Bergmann > > Like gcc, clang-22 now also warns about a function that it > incorrectly identifies as a printf-style format: > > lib/bug.c:190:22: error: diagnostic behavior may be improved by adding the 'format(printf, 1, 0)' attribute to the declaration of '__warn_printf' [-Werror,-Wmissing-format-attribute] > 179 | static void __warn_printf(const char *fmt, struct pt_regs *regs) > | __attribute__((format(printf, 1, 0))) > 180 | { > 181 | if (!fmt) > 182 | return; > 183 | > 184 | #ifdef HAVE_ARCH_BUG_FORMAT_ARGS > 185 | if (regs) { > 186 | struct arch_va_list _args; > 187 | va_list *args = __warn_args(&_args, regs); > 188 | > 189 | if (args) { > 190 | vprintk(fmt, *args); > | ^ > > Turn off this warning for all compilers and versions. > > Fixes: d36067d6ea00 ("bug: Hush suggest-attribute=format for __warn_printf()") > Signed-off-by: Arnd Bergmann > --- > lib/bug.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/bug.c b/lib/bug.c > index bbc301097749..374feb144f0b 100644 > --- a/lib/bug.c > +++ b/lib/bug.c > @@ -174,8 +174,7 @@ struct bug_entry *find_bug(unsigned long bugaddr) > } > > __diag_push(); > -__diag_ignore(GCC, all, "-Wsuggest-attribute=format", > - "Not a valid __printf() conversion candidate."); > +__diag_ignore_all("-Wmissing-format-attribute", "Not a valid __printf() conversion candidate."); > static void __warn_printf(const char *fmt, struct pt_regs *regs) > { > if (!fmt) There is actually a superior fix for this warning that Andy Schevchenko posted here (mine just happened to get merged first): https://lore.kernel.org/all/20251208141618.2805983-1-andriy.shevchenko@linux.intel.com/T/#u Should we just switch over to that? Looks like it should work for both compilers.