Anybody know how to fix it properly? I know I can remove checking from makefile but I would like a proper fix for this also changing bool globalSaveMessage[2]; to [3] in game.h eliminates this but it's just covering this error instead of fixing I guess
C++:
game.cpp: In constructor ‘Game::Game()’:
game.cpp:80:31: error: iteration 2u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
globalSaveMessage[i] = false;
^
game.cpp:79:2: note: containing loop
for(int32_t i = 0; i < 3; i++)
^
game.cpp:80:22: error: array subscript is above array bounds [-Werror=array-bounds]
globalSaveMessage[i] = false;
^
game.cpp: In member function ‘void Game::prepareGlobalSave()’:
game.cpp:6256:30: error: array subscript is above array bounds [-Werror=array-bounds]
else if(!globalSaveMessage[2])
^
game.cpp:6258:22: error: array subscript is above array bounds [-Werror=array-bounds]
globalSaveMessage[2] = true;