Skip to content
  • Simon Marchi's avatar
    dwarf2read: Silence -Wenum-compare-switch warning · 132448f8
    Simon Marchi authored
    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.
    132448f8
To find the state of this project's repository at the time of any of these versions, check out the tags.