From 396ad133315e8f298ff861b522f46b501689a621 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Mar 2022 06:24:36 +0300 Subject: [PATCH] Update for Ubuntu 20.04 g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0 --- cpp/README.txt | 6 ++++++ cpp/Realplexor/Event/Server.h | 4 ++-- cpp/dklab_realplexor.cpp | 2 ++ cpp/utils/checked_map.h | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cpp/README.txt b/cpp/README.txt index 5044721..fd84110 100644 --- a/cpp/README.txt +++ b/cpp/README.txt @@ -17,6 +17,12 @@ For Ubuntu 12.04, the steps are simple: # apt-get install gcc libboost1.48 libev4 libev-dev libmemcached-dev # bash ./Make.sh +Build on Ubuntu 20.04 +--------------------- + +# apt-get install build-essential libboost1.71-all-dev libev4 libev-dev libmemcached-dev +# bash ./Make.sh + Build dklab_realplexor binary on other Linux versions ----------------------------------------------------- diff --git a/cpp/Realplexor/Event/Server.h b/cpp/Realplexor/Event/Server.h index 49e2f79..69015f8 100644 --- a/cpp/Realplexor/Event/Server.h +++ b/cpp/Realplexor/Event/Server.h @@ -91,10 +91,10 @@ class Server: public ServerBase lastAddr = addr; events.push_back(add_listen(addr)); } - } catch (runtime_error e) { + } catch (runtime_error& e) { events.clear(); die(lastAddr + ": " + e.what()); - } catch (exception e) { + } catch (exception& e) { events.clear(); die(lastAddr + ": unknown exception"); } diff --git a/cpp/dklab_realplexor.cpp b/cpp/dklab_realplexor.cpp index 612477a..63466e7 100644 --- a/cpp/dklab_realplexor.cpp +++ b/cpp/dklab_realplexor.cpp @@ -20,6 +20,8 @@ //@ per Storage and one CONFIG, they are like singletons. //@ +#pragma GCC diagnostic ignored "-Wunused-result" + #include #include #include diff --git a/cpp/utils/checked_map.h b/cpp/utils/checked_map.h index 646e2d9..b8830ed 100644 --- a/cpp/utils/checked_map.h +++ b/cpp/utils/checked_map.h @@ -46,7 +46,7 @@ class checked_map: public map { try { return lexical_cast(get(k)); - } catch (bad_lexical_cast e) { + } catch (bad_lexical_cast& e) { throw out_of_range("Error while casting of the key " + k + " presented in " + name); } }