: Prevent uninitalized warning in gengtype-state.c

Submitted by Uros Bizjak on Nov. 25, 2010, 9:51 p.m.

Details

Message ID AANLkTikqYpn-rYZDmzUw=GbvZJpNfMi-pz8m8iPd2+RD@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Nov. 25, 2010, 9:51 p.m.
Hello!

Profiledbootstrap breaks in gengtype-state.c, claiming that "previous"
variable in read_state_structures may be uninitialized.

I have committed attached patch to fix the failure.

2010-11-25  Uros Bizjak  <ubizjak@gmail.com>

	* gengtype-state.c (read_state_structures): Initialize "previous".

Tested on x86_64-pc-linux-gnu {,-m32} with profiledbootstrap.
Committed to SVN mainline.

Uros.

Patch hide | download patch | download mbox

Index: gengtype-state.c
===================================================================
--- gengtype-state.c	(revision 167150)
+++ gengtype-state.c	(working copy)
@@ -2085,7 +2085,7 @@  static void
 read_state_structures (type_p *structures)
 {
   type_p head = NULL;
-  type_p previous;
+  type_p previous = NULL;
   type_p tmp;
   int nbstruct = 0, countstruct = 0;
   struct state_token_st *t0 = peek_state_token (0);