From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: [kvm-unit-tests PATCH] x86/eventinj: Fix flush_cache() macro for the newer versions of Clang
Date: Mon, 13 Apr 2026 11:49:48 +0200 [thread overview]
Message-ID: <20260413094948.14505-1-thuth@redhat.com> (raw)
From: Thomas Huth <thuth@redhat.com>
Clang v21.1.8 from Fedora 43 complains:
x86/eventinj.c:347:2: error: variable '__l' is uninitialized when passed
as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
347 | flush_stack();
| ^~~~~~~~~~~~~
x86/eventinj.c:39:33: note: expanded from macro 'flush_stack'
39 | flush_phys_addr(virt_to_phys(&__l));
| ^~~
Initialize the temporary variable to 0 to avoid the warning.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
x86/eventinj.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86/eventinj.c b/x86/eventinj.c
index e72efa16..7f68bdb8 100644
--- a/x86/eventinj.c
+++ b/x86/eventinj.c
@@ -35,7 +35,7 @@ static void apic_self_nmi(void)
} while (0)
#define flush_stack() do { \
- int __l; \
+ int __l = 0; \
flush_phys_addr(virt_to_phys(&__l)); \
} while (0)
--
2.53.0
reply other threads:[~2026-04-13 9:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260413094948.14505-1-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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