This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gcc warning with "some variable may be used uninitialized in this function [-Wmaybe-uninitialized]" when building under msys
- From: asmwarrior <asmwarrior at gmail dot com>
- To: GDB Development <gdb at sourceware dot org>
- Date: Thu, 4 Oct 2018 14:28:47 +0800
- Subject: gcc warning with "some variable may be used uninitialized in this function [-Wmaybe-uninitialized]" when building under msys
Hi, when building gdb git head(which is 875e539851bb2702f3292f819e220545a8776242 as 2018-10-04) under msys+gcc 5.4, I see such warning:
CXX infrun.o
In file included from ../../binutils-gdb/gdb/inferior.h:49:0,
from ../../binutils-gdb/gdb/infrun.c:26:
../../binutils-gdb/gdb/progspace.h: In function 'void handle_vfork_child_exec_or_exit(int)':
../../binutils-gdb/gdb/progspace.h:285:47: warning: '*((void*)(& maybe_restore_inferior)+16).scoped_restore_current_program_space::m_saved_pspace' may be used uninitialized in this function [-Wmaybe-uninitialized]
{ set_current_program_space (m_saved_pspace); }
^
../../binutils-gdb/gdb/infrun.c:931:6: note: '*((void*)(& maybe_restore_inferior)+16).scoped_restore_current_program_space::m_saved_pspace' was declared here
maybe_restore_inferior;
^
CXX inline-frame.o
Hope you devs can fix this. Thanks.
Asmwarrior