]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
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 5091a9b7bf62cedd46d823dfcd342899e13f1097..9d3290f27bcb39ad9ecba3eae17c8786811aec54 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 331ba0f2bed55c27e90b6f039723694266165c57..e109654f5e41dca2acf0261c1236bc67c58a0107 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".