From b450411ee8f0a57f3ec3909d65ecc289189e2b35 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Mon, 23 Jan 2017 23:53:31 +0100 Subject: Added -Wall for clang and gcc --- CMakeLists.txt | 4 ++-- apps/uscxml-browser.cpp | 2 +- src/uscxml/interpreter/EventQueueImpl.h | 3 +++ src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 6 ++++++ src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16bf183..a7c4cdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,10 +120,10 @@ elseif(COMPILER_SUPPORTS_CXX0X_FLAG) endif() if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall") elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall") elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) add_definitions("-D_SCL_SECURE_NO_WARNINGS") diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index e8d8305..b421f3f 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -54,7 +54,7 @@ int main(int argc, char** argv) { std::list interpreters; for(int i = 0; i < options.interpreters.size(); i++) { - InterpreterOptions* currOptions = options.interpreters[0].second; +// InterpreterOptions* currOptions = options.interpreters[0].second; std::string documentURL = options.interpreters[0].first; LOGD(USCXML_INFO) << "Processing " << documentURL; diff --git a/src/uscxml/interpreter/EventQueueImpl.h b/src/uscxml/interpreter/EventQueueImpl.h index 50ac608..f4c2b54 100644 --- a/src/uscxml/interpreter/EventQueueImpl.h +++ b/src/uscxml/interpreter/EventQueueImpl.h @@ -69,6 +69,9 @@ public: virtual Data serialize() = 0; virtual void deserialize(const Data& data) = 0; +private: + // this will silence the warning about the hidden overloaded virtual function + using EventQueueImpl::create; }; } diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index ad35f80..fccc5f0 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -24,10 +24,16 @@ #include "LuaDataModel.h" // disable forcing to bool performance warning +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4800) +#endif + #include "LuaBridge.h" + +#ifdef _MSC_VER #pragma warning(pop) +#endif #include "uscxml/messages/Event.h" #include "uscxml/util/DOM.h" diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp index 44b975e..b035993 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp @@ -184,6 +184,7 @@ void USCXMLInvoker::invoke(const std::string& source, const Event& invokeEvent) InterpreterImpl* invoked = _invokedInterpreter.getImpl().get(); ActionLanguage al = _callbacks->getActionLanguage(); + // create new instances al.execContent = al.execContent.getImpl()->create(invoked); al.delayQueue = al.delayQueue.getImplDelayed()->create(invoked); al.internalQueue = al.internalQueue.getImplBase()->create(); -- cgit v0.12