[PATCH] Silence GCC "uninitialized" warning on minsyms.c:lookup_minimal_symbol_by_pc_section

Tom Tromey tom@tromey.com
Tue Jun 19 18:47:00 GMT 2018


>>>>> "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



More information about the Gdb-patches mailing list