I used gcc 4.8 until I updated Ubuntu, now I have gcc-4.9.1-16. The code that was used to compile without warnings and executed normally now no longer compiles.
static const unsigned WIDTH = 16; static const unsigned VSCALE = 1; static const unsigned HEIGHT = WIDTH / VSCALE; static const unsigned FOOTER = 2; typedef char Row [WIDTH + 1]; typedef Row World [HEIGHT - FOOTER]; std :: vector <World> m_levels; World levels [] = { { " ", " ", " ", " ", " ", " ### ### ", " ", "1122112211221122", " 33003300330033 ", "1122112211221122", " 33003300330033 ", " ", " ", " " }, { " 44 ", " 555 55 ", " 66 66 ", " 777 777 ", " 66 66 ", " 777 777 ", " 66# #66 ", " 777 # # 777 ", " 66 # # 66 ", " 777 # # 777 ", " 66# #66 ", " 555 55 ", " 44 ", " " } };
Final string errors using
... / foo.cpp: 68: 62: required from here / usr / include / c ++ / 4.9 / bits / stl_algobase.h: 373: 4: error: static statement failed: type is not assigned
... / foo.cpp: 68: 62: required from here / usr / include / c ++ / 4.9 / bits / stl_construct.h: 75: 7: error: initializer in brackets in the array new [-fpermissive]
The compilation options have not changed, they are -W -Wall -Wextra -Werror -pedantic --std=c++0x , as far as I can tell, only gcc has changed.
Why is this code no longer compiling?