tests: ensure backtrace.c exec_dump sets jmp
authorJosh Stone <jistone@redhat.com>
Wed, 11 Feb 2015 22:25:37 +0000 (14:25 -0800)
committerJosh Stone <jistone@redhat.com>
Wed, 11 Feb 2015 23:50:44 +0000 (15:50 -0800)
With CFLAGS='-Og -g', F21 gcc hits -Werror=maybe-uninitialized on jmp in
the call "prepare_thread (pid2, jmp)".  It's fine with -O2/-O0.

The only way this could be unset is if the loop before ran to
completion, and there's already an assert against this case.

This patch initializes jmp anyway to convince gcc it's ok.

Signed-off-by: Josh Stone <jistone@redhat.com>
tests/ChangeLog
tests/backtrace.c

index 5091a9b..9d3290f 100644 (file)
@@ -1,3 +1,7 @@
+2015-02-11  Josh Stone  <jistone@redhat.com>
+
+       * backtrace.c (exec_dump): Initialize jmp.
+
 2015-02-11  Petr Machata  <pmachata@redhat.com>
 
        * run-dwarf-ranges.sh: New test.
index 331ba0f..e109654 100644 (file)
@@ -377,7 +377,7 @@ exec_dump (const char *exec)
 #else /* __x86_64__ */
   is_x86_64_native = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
 #endif /* __x86_64__ */
-  void (*jmp) (void);
+  void (*jmp) (void) = 0;
   if (is_x86_64_native)
     {
       // Find inferior symbol named "jmp".