This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Nios II/GAS: Fix build error in `output_movia'


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3facb0e9a754d2869a139fe135dcd2a58ced2347

commit 3facb0e9a754d2869a139fe135dcd2a58ced2347
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Wed Jan 13 20:58:29 2016 +0000

    Nios II/GAS: Fix build error in `output_movia'
    
    Fix:
    
    cc1: warnings being treated as errors
    .../gas/config/tc-nios2.c: In function 'output_movia':
    .../gas/config/tc-nios2.c:3474: warning: 'code' may be used uninitialized in this function
    make[4]: *** [tc-nios2.o] Error 1
    
    seen with GCC 4.1.2 and 4.4.7.
    
    	gas/
    	* config/tc-nios2.c (output_movia): Preset `code' to 0.

Diff:
---
 gas/ChangeLog         | 4 ++++
 gas/config/tc-nios2.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0b9f95b..a86a071 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-13  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* config/tc-nios2.c (output_movia): Preset `code' to 0.
+
 2016-01-13  Yoshinori Sato  <ysato@users.sourceforge.jp>
 
 	* config/tc-h8300.c (get_operand): Remove spurious condition in
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index e20cf53..db31059 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -3471,7 +3471,7 @@ output_movia (nios2_insn_infoS *insn)
      and puts it in the current frag.  */
   char *f = frag_more (8);
   nios2_insn_relocS *reloc = insn->insn_reloc;
-  unsigned long reg, code;
+  unsigned long reg, code = 0;
   const struct nios2_opcode *op = insn->insn_nios2_opcode;
 
   /* If the reloc is NULL, there was an error assembling the movia.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]