Warnings at compile-time (GCC)
Bug #825957 reported by
Hans Joachim Desserud
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Low
|
Mark Scott |
Bug Description
Noticed some warnings are printed when compiling Widelands. I know there have been some for a while, but I recently compiled it from scratch on Arch and it printed a lot more warnings than what I could remember (maybe due to newer version of gcc checking more thoroughly?)
Most of the warnings are due to unused variables or casting of variables, so nothing critical. Probably a lot of low-hanging fruit here for people who want to get involved in the development.
PS. See also bug 913369 for warnings reported by Clang, and bug 986611 for issues reported by cppcheck.
Related branches
lp:~aber/widelands/classic
- Widelands Developers: Pending requested
- Diff: 0 lines
lp:~peter.waller/widelands/eliminate-unused-arguments
- SirVer: Approve
-
Diff: 1168 lines (+181/-134)51 files modifiedcmake/codecheck/CodeCheck.py (+22/-25)
cmake/codecheck/rules/missing_padding (+4/-1)
cmake/codecheck/run_tests.py (+38/-0)
src/economy/economy.cc (+1/-1)
src/economy/fleet.cc (+5/-5)
src/editor/tools/editor_decrease_height_tool.cc (+2/-2)
src/editor/tools/editor_decrease_resources_tool.cc (+1/-1)
src/editor/tools/editor_draw_tool.cc (+4/-4)
src/editor/tools/editor_increase_height_tool.cc (+1/-1)
src/editor/tools/editor_increase_resources_tool.cc (+1/-1)
src/editor/tools/editor_info_tool.cc (+1/-1)
src/editor/tools/editor_make_infrastructure_tool.cc (+1/-1)
src/editor/tools/editor_noise_height_tool.cc (+1/-1)
src/editor/tools/editor_set_height_tool.cc (+2/-2)
src/editor/tools/editor_set_origin_tool.cc (+2/-2)
src/editor/tools/editor_set_resources_tool.cc (+2/-2)
src/editor/tools/editor_set_terrain_tool.cc (+2/-2)
src/graphic/render/gameview.cc (+10/-10)
src/logic/carrier.cc (+1/-1)
src/logic/immovable.cc (+1/-1)
src/logic/legacy.cc (+2/-2)
src/logic/mapastar.h (+1/-1)
src/logic/production_program.cc (+2/-2)
src/logic/productionsite.cc (+2/-2)
src/logic/warehouse.cc (+7/-7)
src/logic/warehouse.h (+1/-1)
src/logic/worker.cc (+7/-7)
src/map_io/widelands_map_bob_data_packet.cc (+1/-1)
src/map_io/widelands_map_bobdata_data_packet.cc (+1/-1)
src/map_io/widelands_map_ware_data_packet.cc (+1/-1)
src/map_io/widelands_map_waredata_data_packet.cc (+1/-1)
src/network/netclient.cc (+7/-3)
src/network/nethost.cc (+1/-1)
src/scripting/lua_bases.cc (+2/-2)
src/scripting/lua_map.cc (+2/-2)
src/scripting/lua_root.cc (+6/-6)
src/scripting/lua_ui.cc (+6/-6)
src/scripting/persistence.cc (+1/-1)
src/scripting/pluto.cc (+1/-1)
src/scripting/test/test_luna.cc (+9/-9)
src/ui_basic/multilinetextarea.cc (+1/-1)
src/ui_basic/panel.cc (+1/-1)
src/ui_basic/textarea.cc (+1/-1)
src/ui_fsmenu/launchSPG.cc (+1/-1)
src/wui/chatoverlay.cc (+1/-1)
src/wui/game_message_menu.cc (+1/-1)
src/wui/multiplayersetupgroup.cc (+3/-3)
src/wui/plot_area.cc (+1/-1)
src/wui/soldierlist.cc (+6/-1)
src/wui/ware_statistics_menu.cc (+1/-1)
src/wui/waresdisplay.cc (+1/-1)
lp:~mxsscott/widelands/warnings
- Widelands Developers: Pending requested
-
Diff: 739 lines (+145/-96)23 files modifiedsrc/compile_diagnostics.h (+41/-0)
src/editor/editorinteractive.cc (+1/-3)
src/graphic/graphic.cc (+19/-28)
src/graphic/graphic.h (+6/-6)
src/graphic/render/gl_surface.cc (+0/-2)
src/graphic/render/sdl_surface.cc (+12/-3)
src/graphic/text/rt_render.cc (+11/-6)
src/graphic/text/sdl_ttf_font_impl.cc (+2/-2)
src/io/filesystem/disk_filesystem.cc (+7/-10)
src/logic/editor_game_base.cc (+1/-1)
src/minizip/unzip.cc (+4/-0)
src/network/internet_gaming.cc (+3/-0)
src/network/nethost.cc (+2/-0)
src/network/network_lan_promotion.cc (+14/-19)
src/s2map.cc (+10/-8)
src/scripting/pluto.cc (+5/-0)
src/ui_basic/listselect.cc (+0/-1)
src/ui_basic/panel.cc (+0/-2)
src/ui_fsmenu/base.cc (+0/-2)
src/ui_fsmenu/internet_lobby.cc (+3/-0)
src/ui_fsmenu/netsetup_lan.cc (+4/-0)
src/wui/waresdisplay.cc (+0/-2)
src/wui/waresqueuedisplay.cc (+0/-1)
description: | updated |
Changed in widelands: | |
assignee: | nobody → Mark Scott (hono) |
Changed in widelands: | |
status: | Triaged → In Progress |
To post a comment you must log in.
A few things have changed since this bug was filed, so I'm attaching an updated list of warnings. Note that I enabled -Wextra which explains why it prints a lot of extra warnings compared to last time.
Note that I have also filed a bug report on the warnings given by clang (see bug 913369). It would also be nice if someone could file a similar report based on the output from Visual Studio (which I assume is what we use for compilation on Windows).
As I mentioned on the clang bug report, the current warning reports are a bit noisy and quite large. However fixing the issues reported would make it easier to get an overview of which issues remains and also make it easier to notice when new issues are introduced.
(I will likely post newer warning reports from time to time when larger parts of the code have changed in order to keep them up to date.)
Technical details: BUILD_TYPE= Debug -DCMAKE_ INSTALL_ PREFIX= /opt/widelands- clang/build/ -DWL_PORTABLE=true -DWL_EXTRAWARNI NGS=true
Compiled widelands bzr r6183 with gcc 4.6.2 using
cmake ../widelands -DCMAKE_
Note that DWL_EXTRAWARNINGS adds -Wextra warnings in addition to -Wall which is standard.