]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
NDS32/BFD: Fix build error in `nds32_convert_32_to_16'
authorMaciej W. Rozycki <macro@mips.com>
Wed, 16 May 2018 19:43:29 +0000 (20:43 +0100)
committerMaciej W. Rozycki <macro@mips.com>
Wed, 16 May 2018 19:43:29 +0000 (20:43 +0100)
Fix:

cc1: warnings being treated as errors
.../bfd/elf32-nds32.c: In function 'nds32_convert_32_to_16':
.../bfd/elf32-nds32.c:6816: error: 'insn_type' may be used uninitialized in this function
make[4]: *** [elf32-nds32.lo] Error 1

seen with GCC 4.1.2 and 4.4.7.

bfd/
* elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.

bfd/ChangeLog
bfd/elf32-nds32.c

index 8ef34ef390d9c14edbe0f0676150de93f9cb191f..d2c520197093767eae92338003802ce64efbbc4c 100644 (file)
@@ -1,3 +1,7 @@
+2018-05-16  Maciej W. Rozycki  <macro@mips.com>
+
+       * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
+
 2018-05-16  Alan Modra  <amodra@gmail.com>
 
        PR 22458
index 61f48004b4bb0810db7ace24f4d364a459e9b6e3..1b30d127a5ae19684409ffd7c413d655060304fc 100644 (file)
@@ -6808,7 +6808,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
 {
   int op6;
   uint16_t insn16 = 0;
-  int insn_type;
+  int insn_type = 0;
   unsigned long mach = bfd_get_mach (abfd);
 
   /* Decode 32-bit instruction.  */