From 3e809c8c8e301a110b9071c35f55deaa821be322 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 6 Jan 2011 23:31:07 +0000 Subject: [PATCH] - added warnings for gcc for functions that are defined to return a value but they do not - fixed a few defines that do the above --- CMakeLists.txt | 7 +++++-- source/glest_game/network/network_message.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79999f76..698c1b84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,10 +32,13 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) # Default compiler flags #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") ## Strip binary + + # For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html IF(NOT MINGW) - ADD_DEFINITIONS("-fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic") + # For tons of verbose warnings add: -Wall + ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic") ELSE() - ADD_DEFINITIONS("-fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse") + ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse") ENDIF() #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") diff --git a/source/glest_game/network/network_message.h b/source/glest_game/network/network_message.h index 2094b60f..32b0dfb1 100644 --- a/source/glest_game/network/network_message.h +++ b/source/glest_game/network/network_message.h @@ -597,8 +597,8 @@ public: int getToTeam() const {return data.toTeam;} string getNetworkPlayerName() const {return data.networkPlayerName.getString(); } int getSwitchFlags() const {return data.switchFlags;} - int addSwitchFlag(SwitchSetupRequestFlagType flag) { data.switchFlags |= flag;} - int clearSwitchFlag(SwitchSetupRequestFlagType flag) { data.switchFlags &= ~flag;} + void addSwitchFlag(SwitchSetupRequestFlagType flag) { data.switchFlags |= flag;} + void clearSwitchFlag(SwitchSetupRequestFlagType flag) { data.switchFlags &= ~flag;} virtual bool receive(Socket* socket); virtual void send(Socket* socket) const;