This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix compile warning in symtab.c
- From: Tom Tromey <tom at tromey dot com>
- To: "Christian Biesinger via gdb-patches" <gdb-patches at sourceware dot org>
- Cc: Christian Biesinger <cbiesinger at google dot com>
- Date: Fri, 23 Aug 2019 11:03:14 -0600
- Subject: Re: [PATCH] Fix compile warning in symtab.c
- References: <20190822225033.27254-1-cbiesinger@google.com>
>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:
Christian> My compiler (g++ 7.4.0) can't tell that *bsc_ptr and *slot_ptr are
Christian> only used in the cases when it does get initialized. Just initialize
Christian> the vars earlier to avoid the warning, there does not seem to be a
Christian> downside to it.
I think this patch is fine, but I don't understand the connection
between the patch and the warnings.
Christian> ../../gdb/symtab.c: In function ‘block_symbol lookup_static_symbol(const char*, domain_enum)’:
Christian> ../../gdb/symtab.c:1366:11: warning: ‘slot’ may be used uninitialized in this function [-Wmaybe-uninitialized]
It seems to me that if the patch fixes this warning, then it must just
be a gcc bug?
Anyway, this is ok.
Tom