diff --git a/CMakeLists.txt b/CMakeLists.txt index 46acc13d9..c46343712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,7 +327,7 @@ if (ENABLE_SANITIZER) endif() # Configuring compilers -set(OSRM_WARNING_FLAGS "-Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic") +set(OSRM_WARNING_FLAGS "-Wno-used-but-marked-unused -Wno-cast-function-type -Wno-non-virtual-dtor -Wno-undefined-reinterpret-cast -Wno-suggest-destructor-override -Wno-inconsistent-missing-destructor-override -Wno-undefined-func-template -Wno-unused-member-function -Wno-covered-switch-default -Wno-documentation -Wno-unused-template -Wno-global-constructors -Wno-exit-time-destructors -Wno-double-promotion -Wno-float-conversion -Wno-weak-template-vtables -Wno-weak-vtables -Wno-undef -Wno-float-equal -Wimplicit-float-conversion -Wno-shadow -Wno-switch-enum -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-atomic-implicit-seq-cst -Wno-sign-conversion -Wno-suggest-override -Wno-implicit-int-conversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-disabled-macro-expansion -Wno-padded -Wno-shadow-field -Wno-newline-eof -Wno-old-style-cast -Wno-zero-as-null-pointer-constant -Wno-shadow-field-in-constructor -Wno-c++98-compat -Wno-c++98-compat-pedantic -Werror -Wunused -Werror=all -Werror=extra -Werror=uninitialized -Werror=unreachable-code -Werror=unused-variable -Werror=unreachable-code -Wno-error=cpp -Wpedantic") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=2 -Wno-error=unused-local-typedef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument") elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") diff --git a/include/contractor/contract_excludable_graph.hpp b/include/contractor/contract_excludable_graph.hpp index dbfe87da7..2f49e68eb 100644 --- a/include/contractor/contract_excludable_graph.hpp +++ b/include/contractor/contract_excludable_graph.hpp @@ -56,7 +56,7 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_, // By not contracting all contractable nodes we avoid creating // a very dense core. This increases the overall graph sizes a little bit // but increases the final CH quality and contraction speed. - constexpr float BASE_CORE = 0.9; + constexpr float BASE_CORE = 0.9f; is_shared_core = contractGraph(contractor_graph, std::move(always_allowed), node_weights, BASE_CORE); diff --git a/include/engine/api/base_api.hpp b/include/engine/api/base_api.hpp index cc568fb57..8f7ce1de0 100644 --- a/include/engine/api/base_api.hpp +++ b/include/engine/api/base_api.hpp @@ -124,8 +124,8 @@ class BaseAPI const auto &snapped_location = candidatesSnappedLocation(candidates); const auto &input_location = candidatesInputLocation(candidates); auto location = - fbresult::Position(static_cast(util::toFloating(snapped_location.lon)), - static_cast(util::toFloating(snapped_location.lat))); + fbresult::Position(static_cast(static_cast(util::toFloating(snapped_location.lon))), + static_cast(static_cast(util::toFloating(snapped_location.lat)))); const auto toName = [this](const auto &phantom) { return facade.GetNameForID(facade.GetNameIndex(phantom.forward_segment_id.id)) @@ -157,7 +157,7 @@ class BaseAPI auto waypoint = std::make_unique(*builder); waypoint->add_location(&location); waypoint->add_distance( - util::coordinate_calculation::greatCircleDistance(snapped_location, input_location)); + static_cast(util::coordinate_calculation::greatCircleDistance(snapped_location, input_location))); waypoint->add_name(name_string); if (parameters.generate_hints) { diff --git a/include/storage/shared_monitor.hpp b/include/storage/shared_monitor.hpp index 2084112d4..5a8d255d9 100644 --- a/include/storage/shared_monitor.hpp +++ b/include/storage/shared_monitor.hpp @@ -75,7 +75,7 @@ template struct SharedMonitor region = bi::mapped_region(shmem, bi::read_write); } - catch (const bi::interprocess_exception &exception) + catch (const bi::interprocess_exception &) { auto message = boost::format("No shared memory block '%1%' found, have you forgotten " "to run osrm-datastore?") % @@ -124,7 +124,7 @@ template struct SharedMonitor bi::shared_memory_object shmem_open = bi::shared_memory_object(bi::open_only, Data::name, bi::read_only); } - catch (const bi::interprocess_exception &exception) + catch (const bi::interprocess_exception &) { return false; } diff --git a/include/util/query_heap.hpp b/include/util/query_heap.hpp index dc8a2ee53..bf5831bfb 100644 --- a/include/util/query_heap.hpp +++ b/include/util/query_heap.hpp @@ -63,8 +63,6 @@ template class ArrayStorage public: explicit ArrayStorage(std::size_t size) : positions(size, 0) {} - ~ArrayStorage() {} - Key &operator[](NodeID node) { return positions[node]; } Key peek_index(const NodeID node) const { return positions[node]; } diff --git a/include/util/typedefs.hpp b/include/util/typedefs.hpp index b1e962e2e..c6519609d 100644 --- a/include/util/typedefs.hpp +++ b/include/util/typedefs.hpp @@ -118,7 +118,7 @@ static const EdgeDuration MAXIMAL_EDGE_DURATION = std::numeric_limits::max(); static const TurnPenalty INVALID_TURN_PENALTY = std::numeric_limits::max(); static const EdgeDistance INVALID_EDGE_DISTANCE = std::numeric_limits::max(); -static const EdgeDistance INVALID_FALLBACK_SPEED = std::numeric_limits::max(); +static const EdgeDistance INVALID_FALLBACK_SPEED = std::numeric_limits::max(); using DatasourceID = std::uint8_t; diff --git a/src/extractor/extractor.cpp b/src/extractor/extractor.cpp index 388ee866d..c128fc072 100644 --- a/src/extractor/extractor.cpp +++ b/src/extractor/extractor.cpp @@ -196,6 +196,7 @@ std::vector toEdgeList(const util::NodeBasedDynami */ int Extractor::run(ScriptingEnvironment &scripting_environment) { + std::string str; util::LogPolicy::GetInstance().Unmute(); const unsigned recommended_num_threads = std::thread::hardware_concurrency(); diff --git a/src/tools/partition.cpp b/src/tools/partition.cpp index bbc8f10ad..6d1e82007 100644 --- a/src/tools/partition.cpp +++ b/src/tools/partition.cpp @@ -249,7 +249,6 @@ catch (const osrm::RuntimeError &e) { util::DumpMemoryStats(); util::Log(logERROR) << e.what(); - return EXIT_FAILURE; return e.GetCode(); } catch (const std::bad_alloc &e)