bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/16022] New: binutils-2.23.2/bfd/elf32-rx.c:3142: bad switc


From: dcb314 at hotmail dot com
Subject: [Bug binutils/16022] New: binutils-2.23.2/bfd/elf32-rx.c:3142: bad switch statement ?
Date: Wed, 09 Oct 2013 09:45:59 +0000

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

            Bug ID: 16022
           Summary: binutils-2.23.2/bfd/elf32-rx.c:3142: bad switch
                    statement ?
           Product: binutils
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: dcb314 at hotmail dot com

I just ran the static analyser cppcheck over the source code
of binutils-2.23.2

It said

[binutils-2.23.2/bfd/elf32-rx.c:3142] -> [binutils-2.23.2/bfd/elf32-rx.c:3143]:
(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 = "";
    }
      switch (ELF_ST_BIND (isym->st_info))
    {
    case STB_LOCAL: st_info_stb_str = "STB_LOCAL";
    case STB_GLOBAL: st_info_stb_str = "STB_GLOBAL";
    default: st_info_stb_str = "";
    }
      switch (ELF_ST_VISIBILITY (isym->st_other))
    {
    case STV_DEFAULT: st_other_str = "STV_DEFAULT";
    case STV_INTERNAL: st_other_str = "STV_INTERNAL";
    case STV_PROTECTED: st_other_str = "STV_PROTECTED";
    default: st_other_str = "";
    }
      switch (isym->st_shndx)
    {
    case SHN_ABS: st_shndx_str = "SHN_ABS";
    case SHN_COMMON: st_shndx_str = "SHN_COMMON";
    case SHN_UNDEF: st_shndx_str = "SHN_UNDEF";
    default: st_shndx_str = "";
    }

Suggest add some break statements.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]