This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/15993] New: gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement


https://sourceware.org/bugzilla/show_bug.cgi?id=15993

            Bug ID: 15993
           Summary: gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dcb314 at hotmail dot com

I just ran the static analyser cppcheck over gdb-7.6.1

It said many things, including

[gdb-7.6.1/bfd/elf32-m32c.c:920] -> [gdb-7.6.1/bfd/elf32-m32c.c:921]: (warning) 
Variable 'st_info_str' is reassigned a value before the old one has been used.
'
break;' missing?

Source code is

      switch (ELF_ST_TYPE (isym->st_info))
    {
    case STT_FUNC: st_info_str = "STT_FUNC";
    case STT_SECTION: st_info_str = "STT_SECTION";
    case STT_FILE: st_info_str = "STT_FILE";
    case STT_OBJECT: st_info_str = "STT_OBJECT";
    case STT_TLS: st_info_str = "STT_TLS";
    default: st_info_str = "";
    }

Suggest code rework.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]