Opened 7 years ago

Closed 7 years ago

#2507 closed defect (fixed)

Cppcheck warnings for version 1.57

Reported by: vorner Owned by: muks
Priority: medium Milestone: Sprint-20130108
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 2 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

As usual, new version of cppcheck has new errors. After filtering out the
„Skipping configuration“ ones (which are non-fatal and ignored on purpose),
this is the current output. Putting it to next-sprint-proposed, as I already
missed a problem because of this.

src/bin/dhcp6/tests/config_parser_unittest.cc:105: check_fail: Variable 'first' is assigned a value that is never used. (style,unreadVariable)
src/lib/cc/data.cc:313: check_fail: Variable 'c' is reassigned a value before the old one has been used. (performance,redundantAssignment)
src/lib/cc/data.cc:400: check_fail: Variable 'i' is reassigned a value before the old one has been used. (performance,redundantAssignment)
src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:487: check_fail: Variable 'current' is reassigned a value before the old one has been used. (performance,redundantAssignment)
src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:412: check_fail: Variable 'current' is assigned a value that is never used. (style,unreadVariable)
src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:487: check_fail: Variable 'current' is assigned a value that is never used. (style,unreadVariable)
src/lib/dhcp/tests/libdhcp++_unittest.cc:97: check_fail: Variable 'factory' is reassigned a value before the old one has been used. (performance,redundantAssignment)

Subtickets

Change History (6)

comment:1 Changed 7 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20130108

comment:2 Changed 7 years ago by muks

  • Owner set to muks
  • Status changed from new to assigned

Picking

comment:3 in reply to: ↑ description Changed 7 years ago by muks

  • Owner changed from muks to UnAssigned
  • Status changed from assigned to reviewing

Up for review.

This is a false positive (suppression added):

src/bin/dhcp6/tests/config_parser_unittest.cc:105: check_fail: Variable 'first' is assigned a value that is never used. (style,unreadVariable)

These have been fixed:

src/lib/cc/data.cc:313: check_fail: Variable 'c' is reassigned a value before the old one has been used. (performance,redundantAssignment)
src/lib/cc/data.cc:400: check_fail: Variable 'i' is reassigned a value before the old one has been used. (performance,redundantAssignment)

These are false positives (suppressions added):

src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:487: check_fail: Variable 'current' is reassigned a value before the old one has been used. (performance,redundantAssignment)
src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:412: check_fail: Variable 'current' is assigned a value that is never used. (style,unreadVariable)
src/lib/datasrc/tests/memory/rdata_serialization_unittest.cc:487: check_fail: Variable 'current' is assigned a value that is never used. (style,unreadVariable)

This code no longer exists:

src/lib/dhcp/tests/libdhcp++_unittest.cc:97: check_fail: Variable 'factory' is reassigned a value before the old one has been used. (performance,redundantAssignment)

I have re-checked with cppcheck 1.57 to verify that these warnings are gone.

comment:4 Changed 7 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:5 Changed 7 years ago by vorner

  • Owner changed from vorner to muks

Hello

It seems OK to merge.

comment:6 Changed 7 years ago by muks

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged to master branch in commit c8dcb23d366d559cb685b64514f49d7222df3335:

* 00ae760 [2507] Suppress another false positive
* 94cb9c2 [2507] Add cppcheck suppressions
* 7e61e0a [2507] Remove redundant assignments
* 9394663 [2507] Wrap long line

Resolving as fixed. Thank you for the review Michal.

Note: See TracTickets for help on using tickets.