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] NDS32/GAS: Correct an `expr' global shadowing error for pre-4.8 GCC


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

commit 49d519ec2fe80b48f404c0209b41bf8fee47cf39
Author: Maciej W. Rozycki <macro@mips.com>
Date:   Wed May 16 20:43:29 2018 +0100

    NDS32/GAS: Correct an `expr' global shadowing error for pre-4.8 GCC
    
    Remove `-Wshadow' compilation errors:
    
    cc1: warnings being treated as errors
    .../gas/config/tc-nds32.c: In function 'md_assemble':
    .../gas/config/tc-nds32.c:5212: error: declaration of 'expr' shadows a global declaration
    .../gas/expr.h:180: error: shadowed declaration is here
    make[4]: *** [tc-nds32.o] Error 1
    
    which for versions of GCC before 4.8 prevent support for NDS32 targets
    from being built.  See also GCC PR c/53066.
    
    	gas/
    	* tc-nds32.c (md_assemble): Rename `expr' local variable to
    	`insn_expr'.

Diff:
---
 gas/ChangeLog         | 5 +++++
 gas/config/tc-nds32.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index a89ffe1..c2a5659 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-16  Maciej W. Rozycki  <macro@mips.com>
+
+	* tc-nds32.c (md_assemble): Rename `expr' local variable to
+	`insn_expr'.
+
 2018-05-15  Tamar Christina  <tamar.christina@arm.com>
 
 	PR binutils/21446
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 463fe23..01bc17b 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -5209,7 +5209,7 @@ void
 md_assemble (char *str)
 {
   struct nds32_asm_insn insn;
-  expressionS expr;
+  expressionS insn_expr;
   char *out;
   struct nds32_pseudo_opcode *popcode;
   const struct nds32_field *fld = NULL;
@@ -5245,7 +5245,7 @@ md_assemble (char *str)
     }
 
   label_exist = 0;
-  insn.info = & expr;
+  insn.info = &insn_expr;
   asm_desc.result = NASM_OK;
   nds32_assemble (&asm_desc, &insn, str);


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