dwarf2read: Silence -Wenum-compare-switch warning
authorSimon Marchi <simon.marchi@ericsson.com>
Sun, 31 Dec 2017 02:24:29 +0000 (21:24 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Sun, 31 Dec 2017 02:24:42 +0000 (21:24 -0500)
commit132448f8359a268f34f074b0908b5255b568da06
tree6e192a82833b6e9ef4775247f0fe78fdd71e2eb0
parente9d9f57e11db6427db347bc5b9b100071355e63f
dwarf2read: Silence -Wenum-compare-switch warning

Compiling with Clang 6 gives:

/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:24385:14: error: comparison of two values with different enumeration types in switch statement ('enum dwarf_macro_record_type' and 'dwarf_macinfo_record_type') [-Werror,-Wenum-compare-switch]
        case DW_MACINFO_vendor_ext:
             ^~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:24561:7: error: comparison of two values with different enumeration types in switch statement ('enum dwarf_macro_record_type' and 'dwarf_macinfo_record_type') [-Werror,-Wenum-compare-switch]
        case DW_MACINFO_vendor_ext:
             ^~~~~~~~~~~~~~~~~~~~~

This code uses the two enum types on purpose, because it handles both
.debug_macro and .debug_macinfo sections.  Add some pragmas to disable
the warning in these specific cases.

gdb/ChangeLog:

* dwarf2read.c (dwarf_decode_macro_bytes): Ignore
-Wenum-compare-switch warning.
(dwarf_decode_macros): Likewise.
gdb/ChangeLog
gdb/dwarf2read.c