[PATCH] Fix uninitialized use warning in c-parser.c

Andreas Krebbel krebbel@linux.vnet.ibm.com
Fri Oct 17 17:00:00 GMT 2008


I've committed the patch as obvious. (Although obviously not obvious
to me at first go, but probably obvious to others ;)

Bye,

-Andreas-

> So I think you want to initialize
>   location_t binary_loc = UNKNOWN_LOCATION;  /* Quiet warning.  */
> and keep the other line as is.

2008-10-17  Andreas Krebbel  <krebbel1@de.ibm.com>

	* c-parser.c (c_parser_binary_expression): Silence the
	uninitialized variable warning emitted for binary_loc.

Index: gcc/c-parser.c
===================================================================
--- gcc/c-parser.c.orig	2008-10-17 13:56:21.000000000 +0200
+++ gcc/c-parser.c	2008-10-17 15:09:03.000000000 +0200
@@ -4583,7 +4583,7 @@ c_parser_binary_expression (c_parser *pa
   } stack[NUM_PRECS];
   int sp;
   /* Location of the binary operator.  */
-  location_t binary_loc;
+  location_t binary_loc = UNKNOWN_LOCATION;  /* Quiet warning.  */
 #define POP								      \
   do {									      \
     switch (stack[sp].op)						      \



More information about the Gcc-patches mailing list