Starting a few days ago, when I try to compile on Ubuntu 12.04, I get the following error:
src/game.cpp: In member function ‘void game::process_activity()’:
src/game.cpp:1169:69: error: ‘veh’ may be used uninitialized in this function [-Werror=uninitialized]
At global scope:
cc1plus: error: unrecognized command line option "-Wno-maybe-uninitialized" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-narrowing" [-Werror]
cc1plus: all warnings being treated as errors
make: *** [obj/tiles/game.o] Error 1
I’m guessing that “-Wno-maybe-uninitialized” is only supported on newer versions of gcc.
A quick fix I’ve been using is:
[code]diff --git a/src/game.cpp b/src/game.cpp
index d0f6bd9…1a7c46b 100644
— a/src/game.cpp
+++ b/src/game.cpp
@@ -883,7 +883,7 @@ void game::process_activity()
it_book* reading;
item* book_item;
item* reloadable;
- vehicle *veh;
- vehicle *veh = NULL;
bool no_recipes;
if (u.activity.type != ACT_NULL) {
if (int(turn) % 50 == 0) {[/code]
I also suggest “-Wno-maybe-uninitialized” be removed from the compile options, as warnings about the use of uninitialized variables are worthy of attention.