From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: "Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
"Arnd Bergmann" <arnd@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Petr Mladek" <pmladek@suse.com>,
"Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printf: fix Woverride-init warning for EDEADLK errno
Date: Tue, 27 Oct 2020 08:25:43 +0100 [thread overview]
Message-ID: <6f2ee165-781a-5bde-bab9-a7e738f69f18@prevas.dk> (raw)
In-Reply-To: <8f5c673a-0265-a6d0-57fc-98c788caadc9@rasmusvillemoes.dk>
On 27/10/2020 08.23, Rasmus Villemoes wrote:
> How about we do this instead?
>
> From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Missed:
Subject: lib/errname.o: disable -Woverride-init
>
> The table of errno value->name contains a few duplicate entries since
> e.g. EDEADLK == EDEADLOCK on most architectures. For the known cases,
> the most used symbolic constant is listed last so that takes
> precedence - the idea being that if someone sees "can't do that:
> -EDEADLK" in dmesg, grepping for EDEADLK is more likely to find the
> place where that error was generated (grepping for "can't do that"
> will find the printk() that emitted it, but the source would often be
> a few calls down).
>
> However, that means one gets
>
> warning: initialized field overwritten [-Woverride-init]
>
> when building with W=1. As the use of multiple initializers for the
> same entry here is quite deliberate, explicitly disable that warning
> for errname.o.
>
> Reported-by: Arnd Bergmann <arnd@kernel.org>
> Fixes: 57f5677e535b ("printf: add support for printing symbolic error
> names")
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> lib/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/Makefile b/lib/Makefile
> index ce45af50983a2a5e3582..a98119519e100103818d 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -224,6 +224,7 @@ obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
>
> obj-$(CONFIG_DYNAMIC_DEBUG_CORE) += dynamic_debug.o
> obj-$(CONFIG_SYMBOLIC_ERRNAME) += errname.o
> +CFLAGS_errname.o += $(call cc-disable-warning, override-init)
>
> obj-$(CONFIG_NLATTR) += nlattr.o
>
--
Rasmus Villemoes
Software Developer
Prevas A/S
Hedeager 3
DK-8200 Aarhus N
+45 51210274
rasmus.villemoes@prevas.dk
www.prevas.dk
next prev parent reply other threads:[~2020-10-27 7:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 21:49 Arnd Bergmann
2020-10-27 6:55 ` Uwe Kleine-König
2020-10-27 8:41 ` Arnd Bergmann
2020-10-27 7:23 ` Rasmus Villemoes
2020-10-27 7:25 ` Rasmus Villemoes [this message]
2020-10-27 8:46 ` Arnd Bergmann
2020-10-27 9:12 ` Petr Mladek
2020-10-27 10:55 ` Rasmus Villemoes
2020-10-27 12:03 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6f2ee165-781a-5bde-bab9-a7e738f69f18@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--cc=akpm@linux-foundation.org \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pmladek@suse.com \
--cc=uwe@kleine-koenig.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®