This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: 'size' problem



On Sep 13, 2004, at 1:01 AM, Geoff Keating wrote:



doesn't work because because SIZE is 'size', so it becomes


unsigned HOST_WIDE_INT size = size;

which means 'set "size" to be itself, and don't print any warning about using an uninitialised value because I know what I'm doing and am doing this intentionally'.


We really need to turn on -Winit-self for bootstrap so this will print out a
warning and error out in stage2.



I applied this to fix the current problem and I will be submitting a patch
to turn on -Winit-self.


ChangeLog:
	* config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Change variable size's
	name to _new_size.

Index: config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.63
diff -u -p -r1.63 darwin.h
--- config/rs6000/darwin.h	12 Sep 2004 18:30:32 -0000	1.63
+++ config/rs6000/darwin.h	13 Sep 2004 17:19:45 -0000
@@ -242,11 +242,11 @@ do {									\
 #undef  ASM_OUTPUT_ALIGNED_COMMON
 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)			\
   do {									\
-    unsigned HOST_WIDE_INT size = SIZE;					\
+    unsigned HOST_WIDE_INT _new_size = SIZE;				\
     fputs (".comm ", (FILE));						\
     RS6000_OUTPUT_BASENAME ((FILE), (NAME));				\
-    if (size == 0) size = 1;						\
-    fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);	\
+    if (_new_size == 0) _new_size = 1;					\
+    fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", _new_size);	\
   } while (0)

/* Override the standard rs6000 definition. */


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