diff options
author | Jack Lloyd <lloyd@randombit.net> | 2015-12-24 23:52:43 -0500 |
---|---|---|
committer | Jack Lloyd <lloyd@randombit.net> | 2015-12-24 23:52:43 -0500 |
commit | 20e7a430425f20c939e872c932c29330f8db5422 (patch) | |
tree | eedb0992dcd5916a2a3dec7b1236e12f625e467e | |
parent | 9c504c706eec7fd96f728d1da28f6661a3d640b8 (diff) |
Fix a few clang warnings. Set clang sanitizer flags
-rw-r--r-- | src/build-data/cc/clang.txt | 1 | ||||
-rw-r--r-- | src/cli/bench.cpp | 10 | ||||
-rw-r--r-- | src/lib/tls/tls_session_manager.h | 2 | ||||
-rw-r--r-- | src/tests/main.cpp | 6 | ||||
-rw-r--r-- | src/tests/test_rng.h | 2 | ||||
-rw-r--r-- | src/tests/tests.h | 1 |
6 files changed, 7 insertions, 15 deletions
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index b290bbc13..3382f5d65 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -16,6 +16,7 @@ maintainer_warning_flags "-Qunused-arguments -Werror -Wno-error=unused-parameter compile_flags "-c" debug_info_flags "-g" optimization_flags "-O3" +sanitizer_flags "-fsanitize=address,undefined -fsanitize-coverage=edge,indirect-calls,8bit-counters -fno-sanitize-recover=undefined" shared_flags "-fPIC" coverage_flags "--coverage" diff --git a/src/cli/bench.cpp b/src/cli/bench.cpp index d2688421c..ba498d767 100644 --- a/src/cli/bench.cpp +++ b/src/cli/bench.cpp @@ -132,16 +132,6 @@ class Timer uint64_t m_event_count = 0, m_event_mult = 0; }; -inline bool operator<(const Timer& x, const Timer& y) - { - return (x.get_name() < y.get_name()); - } - -inline bool operator==(const Timer& x, const Timer& y) - { - return (x.get_name() == y.get_name()); - } - std::ostream& operator<<(std::ostream& out, Timer& timer) { const double events_per_second = timer.events() / timer.seconds(); diff --git a/src/lib/tls/tls_session_manager.h b/src/lib/tls/tls_session_manager.h index 5ab151c26..e01462f66 100644 --- a/src/lib/tls/tls_session_manager.h +++ b/src/lib/tls/tls_session_manager.h @@ -127,7 +127,7 @@ class BOTAN_DLL Session_Manager_In_Memory : public Session_Manager void remove_entry(const std::vector<byte>& session_id) override; - size_t remove_all(); + size_t remove_all() override; void save(const Session& session_data) override; diff --git a/src/tests/main.cpp b/src/tests/main.cpp index 692bc41af..57a525dbd 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -71,7 +71,7 @@ class Test_Runner : public Botan_CLI::Command const size_t threads = get_arg_sz("threads"); const size_t soak_level = get_arg_sz("soak"); const std::string drbg_seed = get_arg("drbg-seed"); - bool log_success = flag_set("log-success"); + const bool log_success = flag_set("log-success"); const std::string data_dir = get_arg_or("data-dir", "src/tests/data"); std::vector<std::string> req = get_arg_list("suites"); @@ -211,7 +211,9 @@ class Test_Runner : public Botan_CLI::Command for(auto&& test_name : tests_to_run) { auto run_it = [test_name] { - return Botan_Tests::Test::run_test(test_name, false); }; + return Botan_Tests::Test::run_test(test_name, false); + }; + fut_results.push_back(std::async(std::launch::async, run_it)); while(fut_results.size() > threads) diff --git a/src/tests/test_rng.h b/src/tests/test_rng.h index 343356550..83ae9698a 100644 --- a/src/tests/test_rng.h +++ b/src/tests/test_rng.h @@ -32,7 +32,7 @@ class Fixed_Output_RNG : public Botan::RandomNumberGenerator size_t reseed_with_sources(Botan::Entropy_Sources&, size_t, - std::chrono::milliseconds) { return 0; } + std::chrono::milliseconds) override { return 0; } void randomize(uint8_t out[], size_t len) override { diff --git a/src/tests/tests.h b/src/tests/tests.h index e12f5f6de..f98194278 100644 --- a/src/tests/tests.h +++ b/src/tests/tests.h @@ -388,7 +388,6 @@ class Text_Based_Test : public Test std::set<std::string> m_required_keys; std::set<std::string> m_optional_keys; std::string m_output_key; - bool m_clear_between_cb = false; bool m_first = true; std::unique_ptr<std::ifstream> m_cur; |