From 3c9f6f79aba4d300c2b6b74f6d52713c7a78bc76 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Mon, 10 Feb 2020 19:35:17 -0600 Subject: [PATCH] fix some warnings --- depends/protobuf/CMakeLists.txt | 2 +- library/RemoteServer.cpp | 4 ++-- plugins/debug.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/depends/protobuf/CMakeLists.txt b/depends/protobuf/CMakeLists.txt index 93a60ef35..619aba524 100644 --- a/depends/protobuf/CMakeLists.txt +++ b/depends/protobuf/CMakeLists.txt @@ -146,7 +146,7 @@ list(APPEND LIBPROTOBUF_FULL_SRCS ${LIBPROTOBUF_LITE_SRCS}) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-sign-compare") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wno-unused-local-typedefs -Wno-misleading-indentation") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wno-unused-local-typedefs -Wno-misleading-indentation -Wno-class-memaccess") elseif(MSVC) # Disable warnings for integer conversion to smaller type set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp index 523058d55..c934754b0 100644 --- a/library/RemoteServer.cpp +++ b/library/RemoteServer.cpp @@ -240,7 +240,7 @@ void ServerConnection::Accepted(CActiveSocket* socket) std::thread{[](CActiveSocket* socket) { try { ServerConnection(socket).threadFn(); - } catch (BlockedException e) { + } catch (BlockedException &) { } }, socket}.detach(); } @@ -478,7 +478,7 @@ void ServerMainImpl::threadFn(std::promise promise, int port) ServerConnection::Accepted(client); client = nullptr; } - } catch(BlockedException e) { + } catch(BlockedException &) { if (client) client->Close(); delete client; diff --git a/plugins/debug.cpp b/plugins/debug.cpp index 9464305dd..a842de430 100644 --- a/plugins/debug.cpp +++ b/plugins/debug.cpp @@ -537,7 +537,7 @@ command_result FilterManager::saveConfig(DFHack::color_ostream& out) const noexc if (!ofs.good()) throw std::runtime_error{"Failed to open configuration file for writing"}; ofs << archive; - } catch(std::exception e) { + } catch(std::exception & e) { ERR(command, out) << "Serializing filters to '" << configPath << "' failed: " << e.what() << std::endl; return CR_FAILURE; @@ -584,7 +584,7 @@ static command_result parseRegexParam(std::regex& target, try { std::regex temp{parameters[pos], defaultRegex}; target = std::move(temp); - } catch(std::regex_error e) { + } catch(std::regex_error & e) { ERR(command,out) << "Failed to parse regular expression '" << parameters[pos] << "'\n"; ERR(command,out) << "Parser message: " << e.what() << std::endl;