From 48d2a880f9617b81abf849bab8e5699f1b858804 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Fri, 19 Aug 2016 00:17:08 +0100 Subject: [PATCH 1/4] Switch to clang 4 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c51cdd0b86..595321178f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ addons: - g++-5 packages: &core_build_clang_latest - *core_build - - clang-3.9 + - clang-4.0 matrix: fast_finish: true @@ -169,7 +169,7 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "coverage" -o "$TASK" = "doxygen" \) -a "$CXX" = "g++" ]; then export CXX="ccache g++-5" CC="ccache gcc-5"; fi - if [ "$TASK" = "coverity" -a "$CXX" = "g++" ]; then export CXX="ccache g++-4.9" CC="ccache gcc-4.9"; fi #Use the latest clang if we're compiling with clang - - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi + - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-4.0" CC="clang-4.0"; fi #Report the compiler version - $CXX --version From 7b8c188cbdfb57e3f2baf6e3c22e46d4a0cdaedf Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 7 Mar 2017 11:01:43 +0000 Subject: [PATCH 2/4] Switch to Clang 5.0 now it's been whitelisted in https://github.com/travis-ci/apt-package-whitelist/issues/4033 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 83757db0ac..944d033348 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ addons: - g++-5 packages: &core_build_clang_latest - *core_build - - clang-4.0 + - clang-5.0 matrix: fast_finish: true @@ -55,7 +55,7 @@ matrix: - *core_build_clang_latest sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 + - llvm-toolchain-precise - os: linux compiler: gcc env: TASK='compile' @@ -172,7 +172,7 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "coverage" -o "$TASK" = "doxygen" \) -a "$CXX" = "g++" ]; then export CXX="ccache g++-5" CC="ccache gcc-5"; fi - if [ "$TASK" = "coverity" -a "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi #Use the latest clang if we're compiling with clang - - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-4.0" CC="clang-4.0"; fi + - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi #Report the compiler version - $CXX --version From 451c4e32c82c5ce9947f401eb5cb4334b0846845 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 7 Mar 2017 12:41:44 +0000 Subject: [PATCH 3/4] Die if sending DMX failed Correcting an error caught by clang --- examples/ola-throughput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ola-throughput.cpp b/examples/ola-throughput.cpp index 96aa8ea866..75a8d0bce9 100644 --- a/examples/ola-throughput.cpp +++ b/examples/ola-throughput.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) { usleep(FLAGS_sleep); if (!ola_client.SendDmx(FLAGS_universe, buffer)) { cout << "Send DMX failed" << endl; - return false; + exit(1); } } return 0; From d8426e13943afe43df5fb4dd23ddc625c7db057e Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 7 Mar 2017 13:43:50 +0000 Subject: [PATCH 4/4] Fix clang-5.0 errors --- tools/e133/e133-receiver.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/e133/e133-receiver.cpp b/tools/e133/e133-receiver.cpp index 7854b3283a..92b708dedc 100644 --- a/tools/e133/e133-receiver.cpp +++ b/tools/e133/e133-receiver.cpp @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) { vector endpoints; auto_ptr dummy_responder; auto_ptr - discoverable_dummy_responder; + discoverable_dummy_responder; auto_ptr tri_widget; ola::rdm::UIDAllocator uid_allocator(*uid); @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) { dummy_responder.reset(new ola::rdm::DummyResponder(*dummy_uid)); discoverable_dummy_responder.reset( new ola::rdm::DiscoverableRDMControllerAdaptor( - *dummy_uid, dummy_responder.get())); + *dummy_uid, dummy_responder.get())); endpoints.push_back(new E133Endpoint(discoverable_dummy_responder.get(), E133Endpoint::EndpointProperties())); } @@ -251,12 +251,14 @@ int main(int argc, char *argv[]) { } simple_node = &node; - if (!node.Init()) + if (!node.Init()) { exit(ola::EXIT_UNAVAILABLE); + } // signal handler - if (!ola::InstallSignal(SIGINT, &InteruptSignal)) - return false; + if (!ola::InstallSignal(SIGINT, &InteruptSignal)) { + exit(ola::EXIT_OSERR); + } node.Run(); if (e131_node.get()) {