Skip to content

Commit

Permalink
fix clang 10 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhei committed Mar 26, 2020
1 parent 1cb414e commit ac19ebd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
3 changes: 3 additions & 0 deletions bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt
Expand Up @@ -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})
2 changes: 2 additions & 0 deletions bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt
Expand Up @@ -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})
8 changes: 3 additions & 5 deletions bundled/tbb-2018_U2/src/CMakeLists.txt
Expand Up @@ -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")



Expand Down
2 changes: 2 additions & 0 deletions include/deal.II/base/table_handler.h
Expand Up @@ -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>
Expand Down
11 changes: 0 additions & 11 deletions include/deal.II/numerics/matrix_creator.templates.h
Expand Up @@ -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;
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions source/distributed/cell_weights.cc
Expand Up @@ -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!"));

Expand All @@ -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!"));

Expand Down

0 comments on commit ac19ebd

Please sign in to comment.