* infrun.c (follow_fork): Initialize new step_* locals
authorDoug Evans <dje@google.com>
Sun, 24 May 2009 20:55:33 +0000 (20:55 +0000)
committerDoug Evans <dje@google.com>
Sun, 24 May 2009 20:55:33 +0000 (20:55 +0000)
to avoid "may be used uninitialized" warnings.

gdb/ChangeLog
gdb/infrun.c

index cd8671b56d58ff1bc26f89b6eb19d943b60a9ee7..a61114cffcd890cbdbddb075f26df69ad438a3d5 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-24  Doug Evans  <dje@google.com>
+
+       * infrun.c (follow_fork): Initialize new step_* locals
+       to avoid "may be used uninitialized" warnings.
+
 2009-05-24  Pedro Alves  <pedro@codesourcery.com>
 
        * inflow.c (copy_terminal_info): Deep copy `run_terminal'.
index f9b34ddf906a733b6a829f1163866db9687a64d5..bfca0b59eb489f7026c6b6ec21fb69be8cd4d764 100644 (file)
@@ -290,12 +290,12 @@ follow_fork (void)
 
   /* Copy user stepping state to the new inferior thread.  FIXME: the
      followed fork child thread should have a copy of most of the
-     parent thread structure's run control related fields, not just
-     these.  */
-  struct breakpoint *step_resume_breakpoint;
-  CORE_ADDR step_range_start;
-  CORE_ADDR step_range_end;
-  struct frame_id step_frame_id;
+     parent thread structure's run control related fields, not just these.
+     Initialized to avoid "may be used uninitialized" warnings from gcc.  */
+  struct breakpoint *step_resume_breakpoint = NULL;
+  CORE_ADDR step_range_start = 0;
+  CORE_ADDR step_range_end = 0;
+  struct frame_id step_frame_id = { 0 };
 
   if (!non_stop)
     {