This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Silence GCC "uninitialized" warning on minsyms.c:lookup_minimal_symbol_by_pc_section
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Sergio Durigan Junior <sergiodj at redhat dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 19 Jun 2018 12:47:25 -0600
- Subject: Re: [PATCH] Silence GCC "uninitialized" warning on minsyms.c:lookup_minimal_symbol_by_pc_section
- References: <20180325191943.8246-12-palves@redhat.com> <20180618202634.10452-1-sergiodj@redhat.com> <73d51f47-0f68-178f-3a5d-e842a2fa240b@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> The simplest is to add a "default:" case with a gdb_assert, but
Pedro> when I wrote that code, I had not done that on purpose,
Pedro> thinking that I'd prefer it if we enabled "-Wswitch" in gdb, which
Pedro> helps find switch/cases where we need to handle a new enumerator,
Pedro> whenever we add one, like this:
I looked at adding -Wswitch or -Wswitch-enum once. All I really
remember is thinking that there were cases where gdb would not want
this.
However, I think maybe it can be done on a case-by-case basis with
"#pragma GCC diagnostic push".
Tom