mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Foley <pefoley2@pefoley.com>
To: linux-kernel@vger.kernel.org, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org
Cc: Peter Foley <pefoley2@pefoley.com>
Subject: [PATCH] Annotate die() with noreturn
Date: Sat, 26 Nov 2016 17:22:29 -0500	[thread overview]
Message-ID: <20161126222229.673-1-pefoley2@pefoley.com> (raw)

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

             reply	other threads:[~2016-11-26 22:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26 22:22 Peter Foley [this message]
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

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=20161126222229.673-1-pefoley2@pefoley.com \
    --to=pefoley2@pefoley.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

Powered by JetHome