Commit 30848dac authored by Chris Cantwell's avatar Chris Cantwell

Fix gcc warnings on buildbot.

parent abdc4f08
Pipeline #1031 canceled with stages
......@@ -176,7 +176,7 @@ IF (THIRDPARTY_BUILD_BOOST)
SET(Boost_LIBRARY_DIRS ${TPSRC}/dist/lib)
SET(Boost_CONFIG_LIBRARY_DIR ${TPLIB})
INCLUDE_DIRECTORIES(${TPDIST}/include)
INCLUDE_DIRECTORIES(SYSTEM ${TPDIST}/include)
STRING(REPLACE ";" ", " NEEDED_BOOST_LIBS_STRING "${NEEDED_BOOST_LIBS}")
MESSAGE(STATUS "Build boost libs: ${NEEDED_BOOST_LIBS_STRING}")
......@@ -189,4 +189,4 @@ ELSE (THIRDPARTY_BUILD_BOOST)
SET(Boost_CONFIG_LIBRARY_DIR ${Boost_LIBRARY_DIRS})
ENDIF (THIRDPARTY_BUILD_BOOST)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
......@@ -51,14 +51,14 @@ IF (THIRDPARTY_BUILD_CCMIO)
THIRDPARTY_LIBRARY(
CCMIO_ADF_LIBRARY STATIC adf DESCRIPTION "CCMIO ADF library")
INCLUDE_DIRECTORIES(NekMesh ${TPDIST}/include)
INCLUDE_DIRECTORIES(SYSTEM NekMesh ${TPDIST}/include)
MESSAGE(STATUS "Build CCMIO: ${CCMIO_LIBRARY}")
SET(CCMIO_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(libccmio-2.6.1 ALL)
MESSAGE(STATUS "Found CCMIO: ${CCMIO_LIBRARY}")
SET(CCMIO_CONFIG_INCLUDE_DIR ${CCMIO_INCLUDE_DIR})
INCLUDE_DIRECTORIES(NekMesh ${CCMIO_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM NekMesh ${CCMIO_INCLUDE_DIR})
LINK_DIRECTORIES(${CCMIO_LIBRARY_DIR})
ENDIF (THIRDPARTY_BUILD_CCMIO)
......
......@@ -124,7 +124,7 @@ IF (NEKTAR_USE_SCOTCH)
SET(SCOTCH_CONFIG_INCLUDE_DIR ${SCOTCH_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_SCOTCH)
INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIR} ${PTSCOTCH_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${SCOTCH_INCLUDE_DIR} ${PTSCOTCH_INCLUDE_DIR})
LINK_DIRECTORIES(${SCOTCH_LIBRARY_DIR} ${PTSCOTCH_LIBRARY_DIR})
MARK_AS_ADVANCED(SCOTCH_LIBRARY)
......
......@@ -46,6 +46,10 @@ IF( NEKTAR_USE_VTK )
ENDIF()
INCLUDE (${VTK_USE_FILE})
# Force VTK headers to be treated as system headers.
INCLUDE_DIRECTORIES(SYSTEM ${VTK_INCLUDE_DIRS})
MARK_AS_ADVANCED(VTK_DIR)
ADD_DEFINITIONS(-DNEKTAR_USING_VTK)
ENDIF( NEKTAR_USE_VTK )
......
Subproject commit 4cdbe5858c438898266d2b8ff3511b1abdb8b29e
Subproject commit 63551b4436ba27cfd599d8c86554ee94db84d184
......@@ -135,17 +135,19 @@ void InputXml::Process(po::variables_map &vm)
rng->m_doZrange = true;
rng->m_zmin = values[4];
rng->m_zmax = values[5];
/* Falls through. */
case 2:
rng->m_doYrange = true;
rng->m_ymin = values[2];
rng->m_ymax = values[3];
/* Falls through. */
case 1:
rng->m_doXrange = true;
rng->m_xmin = values[0];
rng->m_xmax = values[1];
break;
default:
ASSERTL0(false, "too many values specfied in range");
NEKERROR(ErrorUtil::efatal, "too many values specfied in range");
}
}
......
......@@ -124,17 +124,19 @@ void ProcessInterpField::Process(po::variables_map &vm)
rng->m_doZrange = true;
rng->m_zmin = Vmath::Vmin(npts, coords[2], 1);
rng->m_zmax = Vmath::Vmax(npts, coords[2], 1);
/* Falls through. */
case 2:
rng->m_doYrange = true;
rng->m_ymin = Vmath::Vmin(npts, coords[1], 1);
rng->m_ymax = Vmath::Vmax(npts, coords[1], 1);
/* Falls through. */
case 1:
rng->m_doXrange = true;
rng->m_xmin = Vmath::Vmin(npts, coords[0], 1);
rng->m_xmax = Vmath::Vmax(npts, coords[0], 1);
break;
default:
ASSERTL0(false, "coordim should be <= 3");
NEKERROR(ErrorUtil::efatal, "coordim should be <= 3");
}
// setup rng parameters.
......
......@@ -146,17 +146,19 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
rng->m_zmin -= 1;
rng->m_zmax += 1;
}
/* Falls through. */
case 2:
rng->m_doYrange = true;
rng->m_ymin = Vmath::Vmin(npts, pts[1], 1);
rng->m_ymax = Vmath::Vmax(npts, pts[1], 1);
/* Falls through. */
case 1:
rng->m_doXrange = true;
rng->m_xmin = Vmath::Vmin(npts, pts[0], 1);
rng->m_xmax = Vmath::Vmax(npts, pts[0], 1);
break;
default:
ASSERTL0(false, "too many values specfied in range");
NEKERROR(ErrorUtil::efatal, "too many values specfied in range");
}
// setup rng parameters.
fromField->m_graph =
......
......@@ -482,7 +482,7 @@ Array<OneD, NekDouble> ProcessQualityMetric::GetQ(
}
jacIdeal = jac * i2rm[k];
NekDouble jacDet;
NekDouble jacDet = 1.0;
if (expDim == 2)
{
......@@ -500,7 +500,7 @@ Array<OneD, NekDouble> ProcessQualityMetric::GetQ(
}
else
{
ASSERTL0(false, "silly exp dim");
NEKERROR(ErrorUtil::efatal, "invalid expansion dimension.");
}
if(s)
......
......@@ -113,9 +113,9 @@ void ProcessSurfDistance::Process(po::variables_map &vm)
for (j = 0; j < BndExp[i]->GetExpSize(); ++j, ++cnt)
{
int elmtNum = BoundarytoElmtID[cnt];
int facetNum = BoundarytoTraceID[cnt];
int oppositeNum;
int elmtNum = BoundarytoElmtID[cnt];
int facetNum = BoundarytoTraceID[cnt];
int oppositeNum = 0;
// Get boundary and element expansions.
LocalRegions::ExpansionSharedPtr bndElmt = BndExp[i]->GetExp(j);
......
......@@ -39,6 +39,8 @@
#include <string>
#include <map>
#include <boost/core/ignore_unused.hpp>
#include <LibUtilities/Interpreter/Interpreter.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
......@@ -70,7 +72,7 @@ namespace LibUtilities
class Equation
{
public:
LIB_UTILITIES_EXPORT Equation(const Equation &src) = default;
LIB_UTILITIES_EXPORT Equation(const Equation &) = default;
LIB_UTILITIES_EXPORT Equation(InterpreterSharedPtr evaluator,
const std::string& expr = "",
const std::string& vlist = "");
......
......@@ -921,7 +921,7 @@ void FieldIOXml::ImportFieldDefs(
}
// Get the geometrical shape
ShapeType shape;
ShapeType shape = (ShapeType)0;
bool valid = false;
for (unsigned int j = 0; j < SIZE_ShapeType; j++)
{
......
......@@ -113,7 +113,7 @@ struct PythonToOneDArray
return 0;
}
}
catch (boost::python::error_already_set)
catch (boost::python::error_already_set&)
{
py::handle_exception();
PyErr_Clear();
......
......@@ -1091,13 +1091,13 @@ namespace Nektar
NekDouble sign1,sign2;
DNekScalMatSharedPtr loc_mat;
unsigned int glob_rows;
unsigned int glob_cols;
unsigned int loc_rows;
unsigned int loc_cols;
unsigned int glob_rows = 0;
unsigned int glob_cols = 0;
unsigned int loc_rows = 0;
unsigned int loc_cols = 0;
bool assembleFirstDim;
bool assembleSecondDim;
bool assembleFirstDim = false;
bool assembleSecondDim = false;
switch(mkey.GetMatrixType())
{
......
......@@ -32,6 +32,8 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <boost/core/ignore_unused.hpp>
#include <MultiRegions/GlobalLinSysPETScStaticCond.h>
#include <petscsys.h>
......@@ -289,6 +291,8 @@ namespace Nektar
int scLevel,
NekVector<NekDouble> &F_GlobBnd)
{
boost::ignore_unused(F_GlobBnd);
if (scLevel == 0)
{
// When matrices are supplied to the constructor at the top
......
......@@ -117,9 +117,11 @@ namespace Nektar
{
linSolveType = ePETScFullMatrix;
#ifndef NEKTAR_USING_PETSC
ASSERTL0(false, "Nektar++ has not been compiled with "
"PETSc support.");
NEKERROR(ErrorUtil::efatal,
"Nektar++ has not been compiled with "
"PETSc support.");
#endif
break;
}
case eLinearPreconXxt:
default:
......
......@@ -44,6 +44,7 @@
#include <MultiRegions/ContField2D.h>
#include <MultiRegions/ContField3D.h>
#include <boost/core/ignore_unused.hpp>
#include <boost/format.hpp>
#include <boost/functional/hash.hpp>
......@@ -64,7 +65,7 @@ void CouplingCwipi::InterpCallback(
const int entities_dim,
const int n_local_vertex,
const int n_local_element,
const int n_local_polhyedra,
const int n_local_polyhedra,
const int n_distant_point,
const double local_coordinates[],
const int local_connectivity_index[],
......@@ -83,6 +84,19 @@ void CouplingCwipi::InterpCallback(
const void *local_field,
void *distant_field)
{
boost::ignore_unused(n_local_element, n_local_polyhedra, local_coordinates,
local_connectivity_index, local_connectivity,
local_polyhedra_face_index,
local_polyhedra_cell_to_face_connectivity,
local_polyhedra_face_connectivity_index,
local_polyhedra_face_connectivity,
distant_points_location,
distant_points_distance,
distant_points_barycentric_coordinates_index,
distant_points_barycentric_coordinates,
solver_type,
local_field);
Array<OneD, Array<OneD, NekDouble> > interpField(stride);
Array<OneD, Array<OneD, NekDouble> > distCoords(n_distant_point);
......
......@@ -134,18 +134,18 @@ protected:
const int step,
const NekDouble time,
const Array<OneD, const Array<OneD, NekDouble> > &field,
vector<string> &varNames);
std::vector<std::string> &varNames);
SOLVER_UTILS_EXPORT virtual void v_Receive(
const int step,
const NekDouble time,
Array<OneD, Array<OneD, NekDouble> > &field,
vector<string> &varNames);
std::vector<std::string> &varNames);
SOLVER_UTILS_EXPORT virtual void v_Finalize();
SOLVER_UTILS_EXPORT const NekDouble GetSendField(const int i,
const int j) const
SOLVER_UTILS_EXPORT NekDouble GetSendField(const int i,
const int j) const
{
return m_sendField[i][j];
}
......
......@@ -775,7 +775,7 @@ void FilterAeroForces::CalculateForces(
// Dimension specific part for obtaining values
// at boundary and normal vector
Array<OneD, Array<OneD, NekDouble> > normals;
int nbc;
int nbc = 0;
switch(expdim)
{
case 2:
......@@ -1262,7 +1262,7 @@ void FilterAeroForces::CalculateForcesMapping(
// Dimension specific part for obtaining values
// at boundary and normal vector
Array<OneD, Array<OneD, NekDouble> > normals;
int nbc;
int nbc = 0;
switch(expdim)
{
case 2:
......
......@@ -461,8 +461,8 @@ void FilterHistoryPoints::v_Update(const Array<OneD, const MultiRegions::ExpList
{
locCoord = x.second;
expId = x.first->GetGlobalID();
NekDouble value;
int plane = m_planeIDs[m_historyLocalPointMap[k]];
NekDouble value = 0.0;
const int plane = m_planeIDs[m_historyLocalPointMap[k]];
if (m_waveSpace)
{
......
......@@ -79,8 +79,10 @@ void PointGeom::GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
{
case 3:
z = (*this)(2);
/* Falls through. */
case 2:
y = (*this)(1);
/* Falls through. */
case 1:
x = (*this)(0);
break;
......@@ -93,8 +95,10 @@ void PointGeom::GetCoords(Array<OneD, NekDouble> &coords)
{
case 3:
coords[2] = (*this)(2);
/* Falls through. */
case 2:
coords[1] = (*this)(1);
/* Falls through. */
case 1:
coords[0] = (*this)(0);
break;
......
......@@ -71,12 +71,12 @@ namespace Nektar
ASSERTL2(Bc!=LibUtilities::NullBasisKey,
"NULL Basis attempting to be used.");
m_base[2] = LibUtilities::BasisManager()[Bc];
/* Falls through. */
case 2:
ASSERTL2(Bb!=LibUtilities::NullBasisKey,
"NULL Basis attempting to be used.");
m_base[1] = LibUtilities::BasisManager()[Bb];
/* Falls through. */
case 1:
ASSERTL2(Ba!=LibUtilities::NullBasisKey,
"NULL Basis attempting to be used.");
......
......@@ -855,7 +855,7 @@ namespace Nektar
int i,j;
int cnt=0;
int nummodes0, nummodes1;
int startvalue;
int startvalue = 0;
if(outarray.num_elements()!=GetNcoeffs()-NumBndryCoeffs())
{
outarray = Array<OneD, unsigned int>(GetNcoeffs()-NumBndryCoeffs());
......
......@@ -688,7 +688,7 @@ namespace Nektar
ASSERTL0((dir==0)||(dir==1)||(dir==2),"input dir is out of range");
int nq = GetTotPoints();
MatrixType mtype;
MatrixType mtype = eIProductWRTDerivBase0;
switch (dir)
{
......
......@@ -896,12 +896,15 @@ namespace Nektar
}
default:
ASSERTL0(false,"unexpected points distribution");
NEKERROR(ErrorUtil::efatal,
"unexpected points distribution");
break;
}
break;
}
default:
ASSERTL0(false,"Information not available to set edge key");
NEKERROR(ErrorUtil::efatal,
"Information not available to set edge key");
break;
}
}
......
......@@ -3,6 +3,7 @@
#include <sys/time.h>
#include <iomanip>
#include <boost/core/ignore_unused.hpp>
#include <boost/filesystem/path.hpp>
#include <SpatialDomains/MeshGraph.h>
#include <MultiRegions/ContField2D.h>
......@@ -173,7 +174,8 @@ int main(int argc, char *argv[])
cerr << "Testing HELMHOLTZ" << endl;
break;
default:
cout << "Operator " << opToTest << " not defined." << endl;
NEKERROR(ErrorUtil::efatal,
"Operator " + std::to_string(opToTest) + " not defined.");
}
LibUtilities::SessionReaderSharedPtr vSession
......@@ -400,6 +402,8 @@ NekDouble TimeMatrixOp(StdRegions::MatrixType &type,
int &NumCalls,
NekDouble lambda)
{
boost::ignore_unused(Fce);
//----------------------------------------------
// Do the timings
int i;
......
......@@ -853,7 +853,7 @@ namespace Nektar
int nq = GetTotPoints();
outfield = Array<OneD, NekDouble>(nq, 0.0);
}
/* Falls through. */
default:
{
EquationSystem::v_EvaluateExactSolution(field,outfield,time);
......
......@@ -1013,7 +1013,7 @@ namespace Nektar
{
// make directory and presume will fail if it already exists
string mkdir = "mkdir " + dir;
system(mkdir.c_str());
(void)system(mkdir.c_str());
opendir[dir] = 1;
}
......@@ -1037,7 +1037,7 @@ namespace Nektar
{
// make directory and presume will fail if it already exists
string mkdir = "mkdir " + dir;
system(mkdir.c_str());
(void)system(mkdir.c_str());
opendir[dir] = 1;
}
......
......@@ -109,7 +109,7 @@ void Mvdir(string dir, NekDouble dir_ending)
// make new directory
syscall = "mkdir " + dir;
system(syscall.c_str());
(void)system(syscall.c_str());
}
void DoFixedForcingIteration(VortexWaveInteraction &vwi)
......@@ -166,8 +166,8 @@ void DoFixedForcingIteration(VortexWaveInteraction &vwi)
exit_iteration = true;
}
}
}
break;
case eFixedWaveForcing:
{
int i;
......
......@@ -3644,7 +3644,7 @@ void CheckSingularQuads( MultiRegions::ExpListSharedPtr Exp,
SpatialDomains::Geometry1DSharedPtr SegGeom;
int idbef, idnext;
NekDouble xV1, yV1, xV2,yV2;
NekDouble slopebef,slopenext,slopenew;
NekDouble slopebef = 0.0,slopenext = 0.0,slopenew = 0.0;
Array<OneD, int> locEids(4);
for(int i=0; i<nel; i++)
{
......
......@@ -675,7 +675,7 @@ void InputTec::GenElement2D(vector<NodeSharedPtr> &VertNodes,
{
boost::ignore_unused(i);
LibUtilities::ShapeType elType;
LibUtilities::ShapeType elType = (LibUtilities::ShapeType)0;
// set up Node list
if (ElementFaces.size() == 3)
......@@ -688,7 +688,8 @@ void InputTec::GenElement2D(vector<NodeSharedPtr> &VertNodes,
}
else
{
ASSERTL0(false, "Not set up for elements which are not Tets or Prism");
NEKERROR(ErrorUtil::efatal,
"Not set up for elements which are not Tris or Quads");
}
// Create element tags
......@@ -720,7 +721,7 @@ void InputTec::GenElement3D(vector<NodeSharedPtr> &VertNodes,
{
boost::ignore_unused(i);
LibUtilities::ShapeType elType;
LibUtilities::ShapeType elType = (LibUtilities::ShapeType)0;
// set up Node list
Array<OneD, int> Nodes = SortFaceNodes(VertNodes, ElementFaces, FaceNodes);
int nnodes = Nodes.num_elements();
......@@ -744,8 +745,9 @@ void InputTec::GenElement3D(vector<NodeSharedPtr> &VertNodes,
}
else
{
ASSERTL0(false, "Not set up for elements which are not Tets or Prism");
NEKERROR(ErrorUtil::efatal,
"Not set up for elements which are not Tets, "
"Prisms or Pyramids.");
}
// Create element tags
......
......@@ -408,7 +408,7 @@ void ProcessBL::BoundaryLayer2D()
else
{
// Create new interior nodes.
int pos;
int pos = 0;
for (int k = 1; k < nl; ++k)
{
switch (locEdge)
......@@ -426,7 +426,8 @@ void ProcessBL::BoundaryLayer2D()
pos = nq*nl - k*nq;
break;
default:
ASSERTL0(0,"Quad edge should be < 4.");
NEKERROR(ErrorUtil::efatal,
"Quad edge should be < 4.");
break;
}
edgeNodes[j][k] = NodeSharedPtr(
......@@ -510,7 +511,7 @@ void ProcessBL::BoundaryLayer2D()
int locEdge = (splitEls[el[i]->GetId()]+2*l)%4;
EdgeSharedPtr HOedge = elmt->GetEdge(
locEdge);
int pos;
int pos = 0;
for (int k = 1; k < nq-1; ++k)
{
switch (locEdge)
......@@ -528,7 +529,8 @@ void ProcessBL::BoundaryLayer2D()
pos = (nl+1)*(nq-1) + j - k*(nl+1);
break;
default:
ASSERTL0(0,"Quad edge should be < 4.");
NEKERROR(ErrorUtil::efatal,
"Quad edge should be < 4.");
break;
}
HOedge->m_edgeNodes.push_back(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment