From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 360BA385802A for ; Tue, 9 Jan 2024 13:25:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 360BA385802A Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 360BA385802A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806711; cv=none; b=PUcKo5rAuw/1IBoCMoRay8h8ZtOTVw6lJ1YOX6aEJvg7O60gpjHvGhp9CvBfuqyaoT7Knufik8P3WLGCWUPxkYOmwOC5aV9oXiAOD+srarRAme/5LUJIrPB5/WhPE46eg9IhymBZEVVNU7Q5q4HCDLVKlZiaa8/gQx0AHTeXeK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806711; c=relaxed/simple; bh=x3itFxFIQ2TexhXSeHmsuSXU7CDVVyyMwf36vlgsOl0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=cxwqI0xc+hywWSVSK+4rI1NtB2JfJY8J5YZEm/ApqWWODEN1fWZ5Hwxk86mVSaRH9mjvk5f6/5trZwNZXrHjFKqdtRcnhUGML1V9ZQ4M0/0qHOb46CSqoxChSkAh91L3tNE8jqR7QvfLqrla5XQcC7ApqcA6thdRODMFcVpQfQI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNC6N-0004Rr-2A for gcc@gnu.org; Tue, 09 Jan 2024 08:25:09 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e4d515c9aso11566295e9.0 for ; Tue, 09 Jan 2024 05:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704806704; x=1705411504; darn=gnu.org; h=content-transfer-encoding:in-reply-to:cc:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=X76f2Zy6k85qe6TL2GaPxpYli5p1+tV41uf/b5wKXxA=; b=hih7DVx4SM5rlDox4LecYUGDJS8m3akZgdD5Cv1wapVjq0rTcae0DPNBbBjhhb1GLH nyC/ycshjTb6UHUoOr37F9tiFBeQJzWEeeByzfboKM4dHaByrYJ/aMRtfRIEteBSKvpR hacAzUAxbb5wRzUr+0Q/tRqurkrem90A0dM2RCseUA0wD4E74FS+lAgJhDTAptq4jQ0f cL4BYJ98vRL2qiado89iW78ijpNR9D1wYQ3K2LRBets2Yct6kXzOcupPV6p0KzW2dWa0 kxorPFTJspXxDvenus9CCQEsmMrLdUj+yxv39TP6UkmeUre/00TubSJ0yZxVDaGxY3Pz RzMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704806704; x=1705411504; h=content-transfer-encoding:in-reply-to:cc:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X76f2Zy6k85qe6TL2GaPxpYli5p1+tV41uf/b5wKXxA=; b=YLs5ipcI4O34ISSnX7s+DrnadrO+3PcfoP2KMH5jdm9n2jCdFTRul8IcgJJg0by/no EvEccKJ3ac7jb5OAP4/jrzoM8e+auTM3uaUnPz4PqY+UuV6SbKlCcoCnjfK+BymJzNy/ APgXTZhLY/XFptn9UTkEAPYahHFSz4S0RroEClVfDmwcFaqnPcdOrop4sWe49R4dDsW8 fPD3YdSfAF3xqxjWIsGMXXVTmJY1Y8NHiuR4MT9Qh0zwra4OUByuHPa7HM+YVlbqYmXz T3+KFe1ZPz182LuEPe2hOGW+Q5RFrXykJBUQKESlTPVUPHav25xEqQSK0iDDX7u24Oqw T8vg== X-Gm-Message-State: AOJu0Yz3d746T7sL4I4wpSOzaDs6vXJvj1Tnq+MkKOoacDwEbfMu27GE dw+krYSm1x5HuCykKpaQXbddlhqaS1KXyg== X-Google-Smtp-Source: AGHT+IGVH0TS+FVnWuXW2OZMAlp74ADv7eQGqkF8iyeskz0gxN1fktWZoiBOg/QYT5Weby6A5qMpSA== X-Received: by 2002:a05:600c:2312:b0:40e:4275:5aad with SMTP id 18-20020a05600c231200b0040e42755aadmr2419162wmo.166.1704806704186; Tue, 09 Jan 2024 05:25:04 -0800 (PST) Received: from [192.168.1.47] (213.red-81-40-41.staticip.rima-tde.net. [81.40.41.213]) by smtp.googlemail.com with ESMTPSA id m1-20020a05600c4f4100b0040d5b849f38sm15032128wmq.0.2024.01.09.05.25.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 05:25:03 -0800 (PST) Message-ID: <25d6f0b5-9693-4c16-913e-04c69d317408@gmail.com> Date: Tue, 9 Jan 2024 14:25:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] panic: suppress gnu_printf warning Content-Language: en-GB To: "gcc@gnu.org" References: <20240107091641.579849-1-bhe@redhat.com> <20240107102103.3c0ba0cfa4df37df4b59090e@linux-foundation.org> From: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Cc: Andrew Morton , Baoquan He In-Reply-To: <20240107102103.3c0ba0cfa4df37df4b59090e@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=lopezibanez@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,FREEMAIL_FROM=0.001,RCVD_IN_DNSWL_NONE=-0.0001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 07/01/2024 19:21, Andrew Morton wrote: > On Sun, 7 Jan 2024 17:16:41 +0800 Baoquan He wrote: > >> with GCC 13.2.1 and W=1, there's compiling warning like this: >> >> kernel/panic.c: In function ?__warn?: >> kernel/panic.c:676:17: warning: function ?__warn? might be a candidate for ?gnu_printf? format attribute [-Wsuggest-attribute=format] >> 676 | vprintk(args->fmt, args->args); >> | ^~~~~~~ >> >> The normal __printf(x,y) adding can't fix it. So add workaround which >> disables -Wsuggest-attribute=format to mute it. >> >> ... >> >> --- a/kernel/panic.c >> +++ b/kernel/panic.c >> @@ -666,8 +666,13 @@ void __warn(const char *file, int line, void *caller, unsigned taint, >> pr_warn("WARNING: CPU: %d PID: %d at %pS\n", >> raw_smp_processor_id(), current->pid, caller); >> >> +#pragma GCC diagnostic push >> +#ifndef __clang__ >> +#pragma GCC diagnostic ignored "-Wsuggest-attribute=format" >> +#endif >> if (args) >> vprintk(args->fmt, args->args); >> +#pragma GCC diagnostic pop >> >> print_modules(); > __warn() clearly isn't such a candidate. I'm suspecting that gcc's > implementation of this warning is pretty crude. Is it a new thing in > gcc-13.2? I suspect the warning is about vprintk(), which does seem a printf-like function but something (early inlining?) may be messing up the context and GCC warns about __warn(). This may be bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28492 If vprintk() already has the format attribute, then the messed up function name may be confusing GCC into warning again about it. Best wishes, Manuel.