binutils-2.21.53.0.2/gas bug report

2011-10-23 Thread David Binderman


Hello there,

I just ran the static analysis tool cppcheck over the source
code of binutils-2.21.53.0.2. It said

1.

[binutils-2.21.53.0.2/gas/config/tc-mn10200.c:483]: (warning) Redundant 
assignment of "opcode" in switch

The source code is

case 0xff:
  opcode = 0xfe;
case 0xe8:

There looks to be a missing break in there.

2.

[binutils-2.21.53.0.2/gas/config/tc-mn10200.c:563]: (warning) Redundant 
assignment of "opcode" in switch

Duplicate.

Regards

David Binderman

  ___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


tc-v850.c:1663: possible bad if condition ?

2015-03-02 Thread David Binderman
Hello there,

[src/gas/config/tc-v850.c:1663]: (style) Expression is always false because 
'else if' condition matches previous condition at line 1655.

Source code is

  else if (strcmp (arg, "8byte-align") == 0)
    v850_data_8 = TRUE;
  else if (strcmp (arg, "4byte-align") == 0)
    v850_data_8 = FALSE;
  else if (strcmp (arg, "soft-float") == 0)
    soft_float = 1;
  else if (strcmp (arg, "hard-float") == 0)
    soft_float = 0;
  else if (strcmp (arg, "8byte-align") == 0)
    v850_e_flags |= EF_RH850_DATA_ALIGN8;
  else if (strcmp (arg, "4byte-align") == 0)
    v850_e_flags &= ~ EF_RH850_DATA_ALIGN8;

The last two conditions will never be true. Suggest code rework.

Regards

David Binderman

  
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


src/gold/arm.cc:4513: de-allocation then use ?

2015-11-09 Thread David Binderman
Hello there,

[src/gold/arm.cc:4513]: (error) Returning/dereferencing 'buffer' after it is 
deallocated / released

Source code is

  delete[] buffer;
  return std::string(buffer);

Suggest code rework.

Regards

David Binderman

  
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


src/gdb/remote.c:7724: missing use of va_end ?

2015-11-09 Thread David Binderman
Hello there,

[src/gdb/remote.c:7724]: (error) va_list 'ap' was opened but not closed by 
va_end().

Source code is

  va_start (ap, format);

  rs->buf[0] = '\0';
  if (vsnprintf (rs->buf, max_size, format, ap)>= max_size)
    internal_error (__FILE__, __LINE__, _("Too long remote packet."));

  if (putpkt (rs->buf) < 0)
    error (_("Communication problem with target."));

  rs->buf[0] = '\0';
  getpkt (&rs->buf, &rs->buf_size, 0);

  return packet_check_result (rs->buf);

Regards

David Binderman

  
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


bfd/elf32-nds32.c:9693]: (warning) Redundant assignment

2018-02-11 Thread David Binderman
Hello there,


bfd/elf32-nds32.c:9693]: (warning) Redundant assignment of 'irel->r_addend' to 
itself.


Source code is


  rel->r_offset = rel->r_offset;

Suggest code rework.


Regards


David Binderman

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


bfd/elf32-arc.c:1537]: (warning) Redundant assignment

2018-02-11 Thread David Binderman
Hello there,


bfd/elf32-arc.c:1537]: (warning) Redundant assignment of 'rel->r_offset' to 
itself.

Source code is


 rel->r_offset = rel->r_offset;

Suggest code rework.


Regards


David Binderman

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils