From: Timo Heister <timo.heister@gmail.com>
Date: Thu, 26 Mar 2020 20:59:34 +0000 (-0400)
Subject: fix clang 10 warnings
X-Git-Tag: v9.2.0-rc1~357^2~2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac19ebd3025da17853a4347a132a46dd347c6b99;p=dealii.git

fix clang 10 warnings
---

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/base/exceptions.h>
 
+DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
 #include <boost/serialization/map.hpp>
 #include <boost/serialization/split_member.hpp>
 #include <boost/serialization/string.hpp>
 #include <boost/serialization/vector.hpp>
 #include <boost/variant.hpp>
+DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
 
 #include <fstream>
 #include <map>
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<types::global_dof_index>          dofs;
         std::vector<std::vector<bool>>                dof_is_on_face;
@@ -684,15 +682,6 @@ namespace MatrixCreator
       {}
 
 
-      template <typename DoFHandlerType, typename number>
-      CopyData<DoFHandlerType, number>::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<unsigned int>::max(),
+      Assert(result >= 0. &&
+               result <=
+                 static_cast<float>(std::numeric_limits<unsigned int>::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<unsigned int>::max(),
+      Assert(result >= 0. &&
+               result <=
+                 static_cast<float>(std::numeric_limits<unsigned int>::max()),
              ExcMessage(
                "Cannot cast determined weight for this cell to unsigned int!"));