From: Jan Beulich <jbeulich@suse.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v4 1/2] xen: x86: irq: initialize irq desc in create_irq()
Date: Tue, 8 Apr 2025 09:56:30 +0200 [thread overview]
Message-ID: <ddd716cd-88c9-4146-ae4d-405d66cf08ab@suse.com> (raw)
In-Reply-To: <20250407164608.2558071-2-volodymyr_babchuk@epam.com>
On 07.04.2025 18:46, Volodymyr Babchuk wrote:
> While building xen with GCC 14.2.1 with "-fcondition-coverage" option
> or with "-Og", the compiler produces a false positive warning:
>
> arch/x86/irq.c: In function ‘create_irq’:
> arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
> 281 | ret = init_one_irq_desc(desc);
> | ^~~~~~~~~~~~~~~~~~~~~~~
> arch/x86/irq.c:269:22: note: ‘desc’ was declared here
> 269 | struct irq_desc *desc;
> | ^~~~
> cc1: all warnings being treated as errors
> make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
>
> While we have signed/unsigned comparison both in "for" loop and in
> "if" statement, this still can't lead to use of uninitialized "desc",
> as either loop will be executed at least once, or the function will
> return early. So this is a clearly false positive warning due to a
> bug [1] in GCC.
>
> Initialize "desc" with NULL to make GCC happy.
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Just one other remark here: Personally I dislike the use of multiple or otherwise
excessive patch subject prefixes. xen/x86/irq: or even x86/irq: would have been
better here, imo.
Jan
next prev parent reply other threads:[~2025-04-08 7:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 16:46 [PATCH v4 0/2] Enable MC/DC support for GCC/GCOV Volodymyr Babchuk
2025-04-07 16:46 ` [PATCH v4 1/2] xen: x86: irq: initialize irq desc in create_irq() Volodymyr Babchuk
2025-04-08 6:29 ` Jan Beulich
2025-04-08 7:56 ` Jan Beulich [this message]
2025-04-07 16:46 ` [PATCH v4 2/2] xen: debug: gcov: add condition coverage support Volodymyr Babchuk
2025-04-08 6:34 ` Jan Beulich
2025-04-08 15:38 ` Volodymyr Babchuk
2025-04-08 15:43 ` Jan Beulich
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=ddd716cd-88c9-4146-ae4d-405d66cf08ab@suse.com \
--to=jbeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.