This is the mail archive of the binutils@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]

Patch: [z80] fix shadow warning


Hello,

I have committed the attached patch to trunk and the 2.21 branch to fix a shadow warning, 
which is treated as an error in the branch.
Unfortunately I did not find the time to do it before the release.

Arnold

(trunk)/gas/ChangeLog:
	* config/tc-z80.c (md_apply_fix): Rename var to fix shadow warning.

(branch)/gas/ChangeLog:
	Backport from trunk to fix faillure to compile with -Wshadow -Werror.
	* config/tc-z80.c (md_apply_fix): Rename var to fix shadow warning.
Index: config/tc-z80.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-z80.c,v
retrieving revision 1.12
diff -u -p -r1.12 tc-z80.c
--- config/tc-z80.c	5 Dec 2010 21:44:08 -0000	1.12
+++ config/tc-z80.c	9 Dec 2010 19:57:14 -0000
@@ -1921,7 +1921,7 @@ void
 md_apply_fix (fixS * fixP, valueT* valP, segT seg ATTRIBUTE_UNUSED)
 {
   long val = * (long *) valP;
-  char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
+  char *p_lit = fixP->fx_where + fixP->fx_frag->fr_literal;
 
   switch (fixP->fx_r_type)
     {
@@ -1937,7 +1937,7 @@ md_apply_fix (fixS * fixP, valueT* valP,
 	  if (!fixP->fx_no_overflow)
             as_bad_where (fixP->fx_file, fixP->fx_line,
 			  _("relative jump out of range"));
-	  *buf++ = val;
+	  *p_lit++ = val;
           fixP->fx_done = 1;
         }
       break;
@@ -1954,7 +1954,7 @@ md_apply_fix (fixS * fixP, valueT* valP,
 	  if (!fixP->fx_no_overflow)
             as_bad_where (fixP->fx_file, fixP->fx_line,
 			  _("index offset  out of range"));
-	  *buf++ = val;
+	  *p_lit++ = val;
           fixP->fx_done = 1;
         }
       break;
@@ -1962,34 +1962,34 @@ md_apply_fix (fixS * fixP, valueT* valP,
     case BFD_RELOC_8:
       if (val > 255 || val < -128)
 	as_warn_where (fixP->fx_file, fixP->fx_line, _("overflow"));
-      *buf++ = val;
+      *p_lit++ = val;
       fixP->fx_no_overflow = 1; 
       if (fixP->fx_addsy == NULL)
 	fixP->fx_done = 1;
       break;
 
     case BFD_RELOC_16:
-      *buf++ = val;
-      *buf++ = (val >> 8);
+      *p_lit++ = val;
+      *p_lit++ = (val >> 8);
       fixP->fx_no_overflow = 1; 
       if (fixP->fx_addsy == NULL)
 	fixP->fx_done = 1;
       break;
 
     case BFD_RELOC_24: /* Def24 may produce this.  */
-      *buf++ = val;
-      *buf++ = (val >> 8);
-      *buf++ = (val >> 16);
+      *p_lit++ = val;
+      *p_lit++ = (val >> 8);
+      *p_lit++ = (val >> 16);
       fixP->fx_no_overflow = 1; 
       if (fixP->fx_addsy == NULL)
 	fixP->fx_done = 1;
       break;
 
     case BFD_RELOC_32: /* Def32 and .long may produce this.  */
-      *buf++ = val;
-      *buf++ = (val >> 8);
-      *buf++ = (val >> 16);
-      *buf++ = (val >> 24);
+      *p_lit++ = val;
+      *p_lit++ = (val >> 8);
+      *p_lit++ = (val >> 16);
+      *p_lit++ = (val >> 24);
       if (fixP->fx_addsy == NULL)
 	fixP->fx_done = 1;
       break;

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