Getting warning in MinGW due to unordered initialized members.
Here is Aircraft.cpp/hpp as an example:
$ make
Windows makefile running...
Compiling...
g++ -Wall -std=c++11 -c -s Aircraft.cpp -o ../Temp/Aircraft.o
In file included from Aircraft.cpp:1:0:
Aircraft.hpp: In constructor 'Aircraft::Aircraft(Aircraft::Type, const TextureHolder&, const FontHolder&)':
Aircraft.hpp:76:12: warning: 'Aircraft::mSpawnedPickup' will be initialized after [-Wreorder]
Aircraft.hpp:67:17: warning: 'sf::Sprite Aircraft::mSprite' [-Wreorder]
Aircraft.cpp:23:1: warning: when initialized here [-Wreorder]
In file included from Aircraft.cpp:1:0:
Aircraft.hpp:89:12: warning: 'Aircraft::mIdentifier' will be initialized after [-Wreorder]
Aircraft.hpp:77:12: warning: 'bool Aircraft::mPickupsEnabled' [-Wreorder]
Aircraft.cpp:23:1: warning: when initialized here [-Wreorder]
Following files are affected:
Aircraft.cpp
GameServer.cpp
Player.cpp
Also there is one more warning to get rid of:
Utility.cpp: In function 'std::string toString(sf::Keyboard::Key)':
Utility.cpp:28:9: warning: enumeration value 'KeyCount' not handled in switch [-Wswitch]
Change from:
BOOK_KEYTOSTRING_CASE(F13)
BOOK_KEYTOSTRING_CASE(F14)
BOOK_KEYTOSTRING_CASE(F15)
BOOK_KEYTOSTRING_CASE(Pause)
}
return "";
}
Change this to:
BOOK_KEYTOSTRING_CASE(F13)
BOOK_KEYTOSTRING_CASE(F14)
BOOK_KEYTOSTRING_CASE(F15)
BOOK_KEYTOSTRING_CASE(Pause)
default:
return "";
}
return "";
}
Please update this source code on github. I know it is only warnings but I find them annoying.