From ac19ebd3025da17853a4347a132a46dd347c6b99 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 26 Mar 2020 16:59:34 -0400 Subject: [PATCH] fix clang 10 warnings --- .../boost-1.70.0/libs/iostreams/src/CMakeLists.txt | 3 +++ .../libs/serialization/src/CMakeLists.txt | 2 ++ bundled/tbb-2018_U2/src/CMakeLists.txt | 8 +++----- include/deal.II/base/table_handler.h | 2 ++ include/deal.II/numerics/matrix_creator.templates.h | 11 ----------- source/distributed/cell_weights.cc | 8 ++++++-- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt index beffdb5fd5..7162b575b5 100644 --- a/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt @@ -26,4 +26,7 @@ SET(src_boost_iostreams zlib.cpp ) +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-c11-extensions) + DEAL_II_ADD_LIBRARY(obj_boost_iostreams OBJECT ${src_boost_iostreams}) diff --git a/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt index ed6ba9dc58..bb77b0731c 100644 --- a/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt @@ -59,5 +59,7 @@ SET(src_boost_serialization xml_wiarchive.cpp xml_woarchive.cpp ) +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-c11-extensions) DEAL_II_ADD_LIBRARY(obj_boost_serialization OBJECT ${src_boost_serialization}) diff --git a/bundled/tbb-2018_U2/src/CMakeLists.txt b/bundled/tbb-2018_U2/src/CMakeLists.txt index d87920a234..308d6ebcdd 100644 --- a/bundled/tbb-2018_U2/src/CMakeLists.txt +++ b/bundled/tbb-2018_U2/src/CMakeLists.txt @@ -34,14 +34,12 @@ STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-flifetime-dse=1") # -# Disable all fallthrough warnings: +# Disable other warnings: # ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wimplicit-fallthrough=0") - -# -# Disable string overflow warnings (strncpy, ...): -# ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wstringop-overflow=0") +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated-copy") +ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wtautological-overlap-compare=0") diff --git a/include/deal.II/base/table_handler.h b/include/deal.II/base/table_handler.h index c64bda0c56..63a3f5b014 100644 --- a/include/deal.II/base/table_handler.h +++ b/include/deal.II/base/table_handler.h @@ -21,11 +21,13 @@ #include +DEAL_II_DISABLE_EXTRA_DIAGNOSTICS #include #include #include #include #include +DEAL_II_ENABLE_EXTRA_DIAGNOSTICS #include #include diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index b24a74b452..aeb070944b 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -667,8 +667,6 @@ namespace MatrixCreator { CopyData(); - CopyData(CopyData const &data); - unsigned int dofs_per_cell; std::vector dofs; std::vector> dof_is_on_face; @@ -684,15 +682,6 @@ namespace MatrixCreator {} - template - CopyData::CopyData(CopyData const &data) - : dofs_per_cell(data.dofs_per_cell) - , dofs(data.dofs) - , dof_is_on_face(data.dof_is_on_face) - , cell(data.cell) - , cell_matrix(data.cell_matrix) - , cell_vector(data.cell_vector) - {} } // namespace AssemblerBoundary } // namespace internal } // namespace MatrixCreator diff --git a/source/distributed/cell_weights.cc b/source/distributed/cell_weights.cc index 2980844f31..c6c796695c 100644 --- a/source/distributed/cell_weights.cc +++ b/source/distributed/cell_weights.cc @@ -86,7 +86,9 @@ namespace parallel std::trunc(coefficients.first * std::pow(future_fe.dofs_per_cell, coefficients.second)); - Assert(result >= 0 && result <= std::numeric_limits::max(), + Assert(result >= 0. && + result <= + static_cast(std::numeric_limits::max()), ExcMessage( "Cannot cast determined weight for this cell to unsigned int!")); @@ -109,7 +111,9 @@ namespace parallel result += pair.first * std::pow(future_fe.dofs_per_cell, pair.second); result = std::trunc(result); - Assert(result >= 0 && result <= std::numeric_limits::max(), + Assert(result >= 0. && + result <= + static_cast(std::numeric_limits::max()), ExcMessage( "Cannot cast determined weight for this cell to unsigned int!")); -- 2.39.5