All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Annotate die() with noreturn
@ 2016-11-26 22:22 Peter Foley
  2016-11-28  7:20 ` [tip:x86/urgent] x86/build: Annotate die() with noreturn to fix build warning on clang tip-bot for Peter Foley
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Foley @ 2016-11-26 22:22 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, x86; +Cc: Peter Foley

Fixes below warning with clang:

In file included from ../arch/x86/tools/relocs_64.c:17:                                                                                               ../arch/x86/tools/relocs.c:977:6: warning: variable 'do_reloc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]             if (!use_real_mode)
            ^~~~~~~~~~~~~~                                                                                                                            ../arch/x86/tools/relocs.c:989:14: note: uninitialized use occurs here                                                                                        walk_relocs(do_reloc);                                                                                                                                            ^~~~~~~~                                                                                                                          ../arch/x86/tools/relocs.c:977:2: note: remove the 'if' if its condition is always true
        if (!use_real_mode)
        ^~~~~~~~~~~~~~~~~~~
../arch/x86/tools/relocs.c:974:24: note: initialize the variable 'do_reloc' to silence this warning
                        const char *symname);
                                            ^
                                             = NULL

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
---
 arch/x86/tools/relocs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h
index f59590645b68..1d23bf953a4a 100644
--- a/arch/x86/tools/relocs.h
+++ b/arch/x86/tools/relocs.h
@@ -16,7 +16,7 @@
 #include <regex.h>
 #include <tools/le_byteshift.h>
 
-void die(char *fmt, ...);
+void die(char *fmt, ...) __attribute__((noreturn));
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
-- 
2.11.0.rc2

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

* [tip:x86/urgent] x86/build: Annotate die() with noreturn to fix build warning on clang
  2016-11-26 22:22 [PATCH] Annotate die() with noreturn Peter Foley
@ 2016-11-28  7:20 ` tip-bot for Peter Foley
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Peter Foley @ 2016-11-28  7:20 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, torvalds, mingo, peterz, tglx, pefoley2, linux-kernel

Commit-ID:  adee8705d2517f0e163ffc45e8d7f9e97a58f1f6
Gitweb:     http://git.kernel.org/tip/adee8705d2517f0e163ffc45e8d7f9e97a58f1f6
Author:     Peter Foley <pefoley2@pefoley.com>
AuthorDate: Sat, 26 Nov 2016 17:22:29 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 28 Nov 2016 07:47:22 +0100

x86/build: Annotate die() with noreturn to fix build warning on clang

Fixes below warning with clang:

  In file included from ../arch/x86/tools/relocs_64.c:17:
  ../arch/x86/tools/relocs.c:977:6: warning: variable 'do_reloc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161126222229.673-1-pefoley2@pefoley.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/tools/relocs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h
index f595906..1d23bf9 100644
--- a/arch/x86/tools/relocs.h
+++ b/arch/x86/tools/relocs.h
@@ -16,7 +16,7 @@
 #include <regex.h>
 #include <tools/le_byteshift.h>
 
-void die(char *fmt, ...);
+void die(char *fmt, ...) __attribute__((noreturn));
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 

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

end of thread, other threads:[~2016-11-28  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-26 22:22 [PATCH] Annotate die() with noreturn Peter Foley
2016-11-28  7:20 ` [tip:x86/urgent] x86/build: Annotate die() with noreturn to fix build warning on clang tip-bot for Peter Foley

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.