diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c62ad7a2..68b2b010b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,16 +13,22 @@ option (SLS_USE_TEXTCLIENT "Text Client" OFF) option (SLS_USE_RECEIVER "Receiver" OFF) option (SLS_USE_GUI "GUI" OFF) + +#Flags to always be used +# -Wno-unused-parameter should eventually be removes +# -Wno-overloaded-virtual TODO! remove warnings in refactor +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-overloaded-virtual -Wno-unused-parameter -std=c++98") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # clang does not support -Wno-misleading-indentation - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98") + # add any special clang flags elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation") - else () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation") endif () endif() + + find_package(Qt4) find_package(Qwt 6) find_package(CBF) diff --git a/slsReceiverSoftware/include/GeneralData.h b/slsReceiverSoftware/include/GeneralData.h index e0c66682b..c9276a778 100644 --- a/slsReceiverSoftware/include/GeneralData.h +++ b/slsReceiverSoftware/include/GeneralData.h @@ -155,7 +155,7 @@ public: * @param i pointer to a vector of ROI pointers * @returns adc configured */ - virtual const int GetAdcConfigured(int index, std::vector* i) const{ + virtual int GetAdcConfigured(int index, std::vector* i) const{ cprintf(RED,"This is a generic function that should be overloaded by a derived class\n"); return 0; }; @@ -345,7 +345,7 @@ private: * @param i pointer to a vector of ROI * @returns adc configured */ - const int GetAdcConfigured(int index, std::vector* i) const{ + int GetAdcConfigured(int index, std::vector* i) const{ int adc = -1; // single adc if(i->size()) { diff --git a/slsReceiverSoftware/include/logger.h b/slsReceiverSoftware/include/logger.h index a7b99eefe..124013d48 100644 --- a/slsReceiverSoftware/include/logger.h +++ b/slsReceiverSoftware/include/logger.h @@ -115,7 +115,7 @@ inline std::string NowTime() const int buffer_len = sizeof(buffer); time_t t; time(&t); - tm r = {0}; + tm r = {}; strftime(buffer, buffer_len, "%X", localtime_r(&t, &r)); buffer[buffer_len - 1] = 0; struct timeval tv;