Hi,

this macro caused -Wshadow=local warnings in varasm.c with
the microblaze target.


Only built a bare metal cross compiler that was able to compile
libgcc for that target.

Is it OK for trunk?


Thanks
Bernd.


2019-10-04  Bernd Edlinger  <bernd.edlin...@hotmail.de>

	* defaults.h (ASM_OUTPUT_ASCII): Rename local vars in macro.
	Remove variable hiding code.

Index: gcc/defaults.h
===================================================================
--- gcc/defaults.h	(revision 276484)
+++ gcc/defaults.h	(working copy)
@@ -61,37 +61,32 @@ see the files COPYING3 and COPYING.RUNTIME respect
 #ifndef ASM_OUTPUT_ASCII
 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
   do {									      \
-    FILE *_hide_asm_out_file = (MYFILE);				      \
-    const unsigned char *_hide_p = (const unsigned char *) (MYSTRING);	      \
-    int _hide_thissize = (MYLENGTH);					      \
-    {									      \
-      FILE *asm_out_file = _hide_asm_out_file;				      \
-      const unsigned char *p = _hide_p;					      \
-      int thissize = _hide_thissize;					      \
-      int i;								      \
-      fprintf (asm_out_file, "\t.ascii \"");				      \
+    FILE *_asm_out_file = (MYFILE);					      \
+    const unsigned char *_p = (const unsigned char *) (MYSTRING);	      \
+    int _thissize = (MYLENGTH);						      \
+    int _i;								      \
 									      \
-      for (i = 0; i < thissize; i++)					      \
-	{								      \
-	  int c = p[i];			   				      \
-	  if (c == '\"' || c == '\\')					      \
-	    putc ('\\', asm_out_file);					      \
-	  if (ISPRINT (c))						      \
-	    putc (c, asm_out_file);					      \
-	  else								      \
-	    {								      \
-	      fprintf (asm_out_file, "\\%o", c);			      \
-	      /* After an octal-escape, if a digit follows,		      \
-		 terminate one string constant and start another.	      \
-		 The VAX assembler fails to stop reading the escape	      \
-		 after three digits, so this is the only way we		      \
-		 can get it to parse the data properly.  */		      \
-	      if (i < thissize - 1 && ISDIGIT (p[i + 1]))		      \
-		fprintf (asm_out_file, "\"\n\t.ascii \"");		      \
+    fprintf (_asm_out_file, "\t.ascii \"");				      \
+    for (_i = 0; _i < _thissize; _i++)					      \
+      {									      \
+	int _c = _p[_i];						      \
+	if (_c == '\"' || _c == '\\')					      \
+	  putc ('\\', _asm_out_file);					      \
+	if (ISPRINT (_c))						      \
+	  putc (_c, _asm_out_file);					      \
+	else								      \
+	  {								      \
+	    fprintf (_asm_out_file, "\\%o", _c);			      \
+	    /* After an octal-escape, if a digit follows,		      \
+	       terminate one string constant and start another.		      \
+	       The VAX assembler fails to stop reading the escape	      \
+	       after three digits, so this is the only way we		      \
+	       can get it to parse the data properly.  */		      \
+	    if (_i < _thissize - 1 && ISDIGIT (_p[_i + 1]))		      \
+	      fprintf (_asm_out_file, "\"\n\t.ascii \"");		      \
 	  }								      \
-	}								      \
-      fprintf (asm_out_file, "\"\n");					      \
-    }									      \
+      }									      \
+    fprintf (_asm_out_file, "\"\n");					      \
   }									      \
   while (0)
 #endif

Reply via email to