Commits

Cat Plus Plus committed 3681384

GCC warnings (3).

Comments (0)

Files changed (4)

Goblin Camp/src/Faction.cpp

 	if (active && maxActiveTime >= 0) {
 		++activeTime;
 	}
-};
+}
 
 FactionGoal Faction::GetCurrentGoal() const {
 	size_t i = currentGoal;

Goblin Camp/src/Map.cpp

 	}
 	waterlevel = -0.8f;
 	weather = boost::shared_ptr<Weather>(new Weather(this));
-};
+}
 
 Map::~Map() {
 	delete heightMap;

Goblin Camp/src/data/Paths.cpp

 		// every value' warning. So, crash and burn.
 		LOG("Impossible code path, crashing.");
 		assert(false);
-		return fs::path();
+#if defined(__GNUC__)
+		__builtin_unreachable(); // to silence the warning
+#endif
 	}
 	
 #if defined(_MSC_VER)

Goblin Camp/src/tileRenderer/ogl/OGLFunctionExt.cpp

 #include <SDL_opengl.h>
 #include "tileRenderer/ogl/OGLFunctionExt.hpp"
 
+// XXX this code is not fully conformant — void* (as returned by SDL_GL_GetProcAddress)
+// is not guaranteed to be able to hold a function pointer by C++.
+
+#ifdef __GNUC__
+#	if __GNUC_MINOR__ > 5
+#		pragma GCC diagnostic push
+#	endif
+#	pragma GCC diagnostic ignored "-pedantic"
+#endif
+
 namespace OGLFunctionExtension {
-	
 	GLhandleARB glCreateShaderObjectARB(GLenum shaderType) {
 		static PFNGLCREATESHADEROBJECTARBPROC function((PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"));
 		return function(shaderType);
 		function(handle);
 	}
 
-	#ifdef WINDOWS 
+	#ifdef WINDOWS
 		void glActiveTexture(GLenum texture) {
 			static PFNGLACTIVETEXTUREPROC function((PFNGLACTIVETEXTUREPROC)SDL_GL_GetProcAddress("glActiveTexture"));
 			function(texture);
 		}
 	#endif
+}
 
-}
+#if defined(__GNUC__) && __GNUC_MINOR__ > 5
+#	pragma GCC diagnostic pop
+#endif