This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Nios II/GAS: Fix build error in `output_movia'
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>, Andrew Jenner <andrew at codesourcery dot com>, Tristan Gingold <gingold at adacore dot com>
- Cc: <binutils at sourceware dot org>
- Date: Thu, 7 Jan 2016 15:32:28 +0000
- Subject: [PATCH] Nios II/GAS: Fix build error in `output_movia'
- Authentication-results: sourceware.org; auth=none
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.
---
It has come up in my regular testing for unrelated features. I haven't
checked other GCC versions; presumably the warning has gone away with a
more recent version.
OK to apply? How about 2.26?
Maciej
binutils-nios2-gas-build-fix.diff
Index: binutils/gas/config/tc-nios2.c
===================================================================
--- binutils.orig/gas/config/tc-nios2.c 2015-09-11 18:32:12.000000000 +0100
+++ binutils/gas/config/tc-nios2.c 2015-11-20 11:08:15.636397734 +0000
@@ -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. */