All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86: setjmp: ignore clang's "-Wsomtimes-uninitialized" flag
@ 2019-09-09 21:09 Bill Wendling
  2019-09-10 16:46 ` Jim Mattson
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Wendling @ 2019-09-09 21:09 UTC (permalink / raw)
  To: kvm

Clang complains that "i" might be uninitialized in the "printf"
statement. This is a false negative, because it's set in the "if"
statement and then incremented in the loop created by the "longjmp".

Signed-off-by: Bill Wendling <morbo@google.com>
---
 x86/setjmp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/x86/setjmp.c b/x86/setjmp.c
index 976a632..cf9adcb 100644
--- a/x86/setjmp.c
+++ b/x86/setjmp.c
@@ -1,6 +1,10 @@
 #include "libcflat.h"
 #include "setjmp.h"

+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wsometimes-uninitialized"
+#endif
+
 int main(void)
 {
     volatile int i;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-11  2:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 21:09 [kvm-unit-tests PATCH] x86: setjmp: ignore clang's "-Wsomtimes-uninitialized" flag Bill Wendling
2019-09-10 16:46 ` Jim Mattson
2019-09-10 17:59   ` Sean Christopherson
2019-09-11  1:42     ` Bill Wendling
2019-09-11  2:32       ` Bill Wendling

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.