Dead assignment or increment (variables which have values assigned, but are then never read again)

Bug #1044939 reported by Hans Joachim Desserud on 2012-09-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

Found by the clang static analyzer (clang 3.3) in Widelands bzr r6594. (Does not include issues found in minizip and pluto, since we would like to keep the source of those unmodified)

Description: Value stored to 'dnew_2' is never read
File: /home/arch/widelands/src/economy/test/test_routing.cc
Line: 459

Description: Value stored to 'posx' is never read
File: /home/arch/widelands/src/wui/story_message_box.cc
Line: 71

Description: Value stored to 'posy' is never read
File: /home/arch/widelands/src/editor/ui_menus/editor_main_menu_new_map.cc
Line: 127

Description: Value stored to 'posx' is never read
File: /home/arch/widelands/src/editor/ui_menus/editor_player_menu.cc
Line: 184

Description: Value stored to 'totalbreadth' is never read
File: /home/arch/widelands/src/ui_basic/box.cc
Line: 151

Description: Value stored to 'totalbreadth' is never read
File: /home/arch/widelands/src/ui_basic/box.cc
Line: 156

(Note that some of these will also show up as compilation warnings)

description: updated
description: updated
SirVer (sirver) wrote :

I think most of them are correctly identified and should be fixed but are not critical. I would suggest to leave the minizip code alone - ideally we do not wish to bundle this in the first place.

This seems like a low hanging fruit for new developers to get started in the code base.

Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
tags: added: fixes lowhangingfruit
description: updated
SirVer (sirver) wrote :

I fixed all of these in r6599.

Changed in widelands:
status: Confirmed → Fix Committed
milestone: none → build18-rc1
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers