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] ARC/GAS: Correct a `spaces' global shadowing error


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

commit 731f7c4ea30cc409c45412eec15e3d66afe051f5
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Thu Dec 8 22:55:42 2016 +0000

    ARC/GAS: Correct a `spaces' global shadowing error
    
    Fix a commit a9752fdf8398 ("[ARC] Sync cpu names with the ones accepted
    by GCC.") build regression:
    
    cc1: warnings being treated as errors
    .../gas/config/tc-arc.c: In function 'arc_show_cpu_list':
    .../gas/config/tc-arc.c:3452: error: declaration of 'spaces' shadows a global declaration
    .../gas/../include/libiberty.h:248: error: shadowed declaration is here
    make[4]: *** [tc-arc.o] Error 1
    
    in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command
    line options used when compiling the binutils.").
    
    	gas/
    	* config/tc-arc.c (arc_show_cpu_list): Rename `spaces' local
    	variable to `space_buf'.

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

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 7def377..f05bcd4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2016-12-08  Maciej W. Rozycki  <macro@imgtec.com>
 
+	* config/tc-arc.c (arc_show_cpu_list): Rename `spaces' local
+	variable to `space_buf'.
+
+2016-12-08  Maciej W. Rozycki  <macro@imgtec.com>
+
 	* config/tc-arm.c (encode_arm_shift): Rename `index' local
 	variable to `op_index'.
 
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index cebf198..3542cdc 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -3449,10 +3449,10 @@ static void
 arc_show_cpu_list (FILE *stream)
 {
   int i, offset;
-  static const char *spaces = "                          ";
+  static const char *space_buf = "                          ";
 
-  fprintf (stream, "%s", spaces);
-  offset = strlen (spaces);
+  fprintf (stream, "%s", space_buf);
+  offset = strlen (space_buf);
   for (i = 0; cpu_types[i].name != NULL; ++i)
     {
       bfd_boolean last = (cpu_types[i + 1].name == NULL);
@@ -3462,8 +3462,8 @@ arc_show_cpu_list (FILE *stream)
          characters, then it's time for a new line.  */
       if (offset + strlen (cpu_types[i].name) + (last ? 0 : 2) > 80)
         {
-          fprintf (stream, "\n%s", spaces);
-          offset = strlen (spaces);
+          fprintf (stream, "\n%s", space_buf);
+          offset = strlen (space_buf);
         }
 
       fprintf (stream, "%s%s", cpu_types[i].name, (last ? "\n" : ", "));


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