FTBFS with clang 3.6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Attempted to build r7439 from source with clang-3.6:
$ cmake -DCMAKE_
$ make
but ran into the following error (in addition to plenty of warnings):
/home/debian/
1 warning and 1 error generated.
make[2]: *** [src/ui_
make[1]: *** [src/ui_
make: *** [all] Error 2
There might be more issues since at least cppcheck has reported that various fields are uninitialized for a long time. Not sure why we haven't seen this before. Either clang-3.6 does a more thorough check, or no one has built the game from scratch with clang in a while. (According to bug 1258667, it went completely fine to build the game with clang-3.5 last September)
Related branches
- GunChleoc: Approve
-
Diff: 256 lines (+33/-34)14 files modifiedsrc/ai/ai_hints.cc (+2/-1)
src/base/log.h (+7/-7)
src/config.h.cmake (+3/-3)
src/graphic/font_handler1.cc (+2/-2)
src/logic/ship.h (+1/-1)
src/scripting/lua_map.cc (+4/-4)
src/scripting/luna.h (+8/-8)
src/ui_basic/editbox.h (+1/-1)
src/ui_basic/multilineeditbox.h (+1/-1)
src/ui_fsmenu/loadgame.h (+1/-1)
src/ui_fsmenu/main.cc (+1/-1)
src/ui_fsmenu/multiplayer.cc (+1/-1)
src/ui_fsmenu/singleplayer.cc (+1/-1)
src/wui/interactive_base.h (+0/-2)
Changed in widelands: | |
status: | Triaged → In Progress |
assignee: | nobody → SirVer (sirver) |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
I did some research along the lines of how could we have known and caught this sooner, so I've set up a new PPA [1]. It is similar to the regular PPA, except it adds clang to the build dependencies and forces compilation to happen with clang and clang++. (It should be noted that it probably doesn't follow best practices on how to do this because a package should really use whatever the default compiler is on the system, but it works).
At the moment it is set up to build with Ubuntu 14.04, 14.10 and the upcoming Vivid release which will presumably turn into 15.04 later this month. As luck would have it, this corresponds to clang 3.4, 3.5 and 3.6 respectively. (We'll lose 3.5 in some months time when 14.10 reaches end of life, but still...) This should allow us to follow the current state and react sooner when something breaks in trunk.
Thanks to this research it also became clear that it was in fact clang 3.6 with some stricter rules/parsing/ something which broke this.
For the meantime the PPA is owned by me, but long-term we might want to move ownership to widelands-dev. Part of the reason I didn't do this immediately is that a) it is broken and b) I wanted to clearly mark it as unoffical. I like the dialy-PPA we have at the moment which is a single place you can go to fetch the latest development release. It could be argued that a clang-PPA with latest packages would be equivalent but I don't see any way it won't end up being stored separately, and I'd rather avoid the "which- PPA-should- I-use" and "I-have- this,do- you-have- that-are- they-compatible " confusion. But we can discuss this part.
PS. How I picked the name for the PPA? 50% tale of the canaries in the coal mines and 50% alliterations are always awesome!
[1] https:/ /code.launchpad .net/~hjd/ +recipe/ widelands- clang-compilati on-canary