Can't compile tiles, undefined variables :S


#1

Hi people! don’t know if this is the correct category lol
when compiling lastest experimental in Linux i get the following warning:

 src/sdltiles.cpp: In function ‘curses_drawwindow’:
src/mapdata.h:254:0: error: ‘connect_group’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             return ( connect_group != TERCONN_NONE ) && ( connect_group == test_connect_group );
 ^
src/cata_tiles.cpp:2224:9: note: ‘connect_group’ was declared here
     int connect_group;
         ^
lto1: all warnings being treated as errors

connect_group used is actually declared in mapdata.h:248 and yeah… it MAY BE uninitialized.
I could just initialize it to TERCONN_NONE which seems default but wanted some input on it… or some way to disable warnings :P.


#2

Initializing it is the way to go, but it’s strange that it’s not erroring in mainline, we definitely have -Wall -Werror set. I wonder if this is occurring with LTO only, I don’t think we’re using it in official builds.

As for disabling warnings, I believe you can set a variable to inject the appropriate -Wno-whatever-warning flag, but I don’t recall what it is offhand. There’s a big block of comments at the top of the Makefile outlining configuration options.


#3

What’s your make command line?


#4

Strange indeed, tried without LTO with same results.
I use: make -j4 CCACHE=1 TILES=1 LTO=1 SOUND=1 LUA=1 RELEASE=1 LOCALIZE=0


#5

Try building with this command line
be sure to perform a make clean before you start.
make TILES=1 SOUND=1 RELEASE=1 LOCALIZE=0

I was able to successfully compile mainline just fine with these switches.


#6

Thanks! that worked great, added lua also without problem.