Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444573 > unrolled thread

[PATCH 24/24] objtool: Initialize variable to silence old compiler

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-07-15 23:00 +0200
Last post2016-07-15 23:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 24/24] objtool: Initialize variable to silence old compiler Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-15 23:00 +0200

#1444573 — [PATCH 24/24] objtool: Initialize variable to silence old compiler

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-07-15 23:00 +0200
Subject[PATCH 24/24] objtool: Initialize variable to silence old compiler
Message-ID<rVing-38N-25@gated-at.bofh.it>
From: Arnaldo Carvalho de Melo <acme@redhat.com>

gcc version 4.1.2 20080704 (Red Hat 4.1.2-55) barfs with:

    CC       /tmp/build/objtool/builtin-check.o
  cc1: warnings being treated as errors
  builtin-check.c: In function 'cmd_check':
  builtin-check.c:667: warning: 'prev_rela' may be used uninitialized in this function
  mv: cannot stat `/tmp/build/objtool/.builtin-check.o.tmp': No such file or directory
  make[1]: *** [/tmp/build/objtool/builtin-check.o] Error 1

Init it to NULL to silence it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qolo31rl2ojlwj1lj9dhemyz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/objtool/builtin-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 92d84b277032..4ed30f45c6da 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -664,7 +664,7 @@ static int add_func_switch_tables(struct objtool_file *file,
 				  struct symbol *func)
 {
 	struct instruction *insn, *prev_jump;
-	struct rela *text_rela, *rodata_rela, *prev_rela;
+	struct rela *text_rela, *rodata_rela, *prev_rela = NULL;
 	int ret;
 
 	prev_jump = NULL;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web