This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] NDS32/BFD: Fix build error in `nds32_convert_32_to_16'
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: <binutils at sourceware dot org>
- Cc: Kuan-Lin Chen <kuanlinchentw at gmail dot com>, Wei-Cheng Wang <cole945 at gmail dot com>
- Date: Tue, 15 May 2018 15:45:58 +0100
- Subject: [PATCH] NDS32/BFD: Fix build error in `nds32_convert_32_to_16'
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'.
---
Hi,
I will commit this as obvious in a few days' time unless I hear
objections.
Maciej
---
bfd/elf32-nds32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
binutils-nds32-insn-type-uninitialized.diff
Index: binutils/bfd/elf32-nds32.c
===================================================================
--- binutils.orig/bfd/elf32-nds32.c 2018-04-30 09:23:19.357183482 +0100
+++ binutils/bfd/elf32-nds32.c 2018-04-30 09:26:45.387465766 +0100
@@ -6808,7 +6808,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint3
{
int op6;
uint16_t insn16 = 0;
- int insn_type;
+ int insn_type = 0;
unsigned long mach = bfd_get_mach (abfd);
/* Decode 32-bit instruction. */