Commit 62e40b34 authored by gsell's avatar gsell
Browse files

Merge branch '478-fix-warnings-with-gcc-9-2-and-wextra-and-some-cleanup' into 'master'

Resolve "fix warnings with GCC 9.2 and -Wextra and some cleanup"

Closes #478

See merge request !292
parents 269b7b0d 855f4936
...@@ -46,7 +46,7 @@ add_definitions (-DNOCTAssert) ...@@ -46,7 +46,7 @@ add_definitions (-DNOCTAssert)
add_compile_options (-Wall) add_compile_options (-Wall)
add_compile_options (-Wunused) add_compile_options (-Wunused)
add_compile_options (-Wextra) add_compile_options (-Wextra)
#add_compile_options (-Werror) add_compile_options (-Werror)
add_compile_options (-funroll-loops) add_compile_options (-funroll-loops)
add_compile_options (-fstrict-aliasing) add_compile_options (-fstrict-aliasing)
...@@ -67,9 +67,7 @@ if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" ) ...@@ -67,9 +67,7 @@ if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
endif () endif ()
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options (-Wsign-compare) add_compile_options (-Warray-bounds-pointer-arithmetic)
add_compile_options (-Wunused-variable)
add_compile_options (-Warray-bounds)
# Increase template depth for boost # Increase template depth for boost
add_compile_options (-ftemplate-depth=1024) add_compile_options (-ftemplate-depth=1024)
# get rid of linking warning with boost. Looks like that boost # get rid of linking warning with boost. Looks like that boost
......
...@@ -256,6 +256,9 @@ FFTPACK<T>::callFFT(unsigned transformDim, int direction, T* data) { ...@@ -256,6 +256,9 @@ FFTPACK<T>::callFFT(unsigned transformDim, int direction, T* data) {
// check transform dimension and direction arguments // check transform dimension and direction arguments
PAssert_LT(transformDim, numTransformDims_m); PAssert_LT(transformDim, numTransformDims_m);
// avoid unused variable warning if we compile with Release
// :FIXME: remove direction
(void)direction;
PAssert_EQ(std::abs(direction), 1); PAssert_EQ(std::abs(direction), 1);
// branch on transform type for this dimension // branch on transform type for this dimension
......
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
*
* This program was prepared by PSI.
* All rights in the program are reserved by PSI.
* Neither PSI nor the author(s)
* makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software
*
* Visit www.amas.web.psi for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
* *
***************************************************************************/ ***************************************************************************/
...@@ -113,7 +94,7 @@ TryCompressLHS(LField<T,Dim>& lf, A& rhs, Op op, const NDIndex<Dim>& domain) ...@@ -113,7 +94,7 @@ TryCompressLHS(LField<T,Dim>& lf, A& rhs, Op op, const NDIndex<Dim>& domain)
// is for assignment. // is for assignment.
if (c1 && c3 && c4) if (c1 && c3 && c4)
{ {
T tmpval; T tmpval{};
PETE_apply(op, tmpval, for_each(rhs, EvalFunctor_0())); PETE_apply(op, tmpval, for_each(rhs, EvalFunctor_0()));
if (*lf.begin() == tmpval) if (*lf.begin() == tmpval)
{ {
...@@ -676,9 +657,10 @@ assign(const BareField<T1,Dim>& ca, RHS b, OP op, ExprTag<true>) ...@@ -676,9 +657,10 @@ assign(const BareField<T1,Dim>& ca, RHS b, OP op, ExprTag<true>)
//INCIPPLSTAT(incBFEqualsExpression); //INCIPPLSTAT(incBFEqualsExpression);
} }
// vi: set et ts=4 sw=4 sts=4:
/*************************************************************************** // Local Variables:
* $RCSfile: Assign.cpp,v $ $Author: adelmann $ // mode:c
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $ // c-basic-offset: 4
* IPPL_VERSION_ID: $Id: Assign.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ // indent-tabs-mode: nil
***************************************************************************/ // require-final-newline: nil
// End:
...@@ -2795,8 +2795,6 @@ void ExtrapolateFace<T,D,M,C>::apply( Field<T,D,M,C>& A ) ...@@ -2795,8 +2795,6 @@ void ExtrapolateFace<T,D,M,C>::apply( Field<T,D,M,C>& A )
} }
//#pragma GCC push_options
//#pragma GCC optimize "no-tree-vrp"
template<class T, unsigned D, class M, class C> template<class T, unsigned D, class M, class C>
inline void inline void
ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src, ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src,
...@@ -2862,7 +2860,6 @@ ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src, ...@@ -2862,7 +2860,6 @@ ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src,
(ef.getOffset(),ef.getSlope(),ef.getComponent())).apply(); (ef.getOffset(),ef.getSlope(),ef.getComponent())).apply();
} }
} }
//#pragma GCC pop_options
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
...@@ -9,18 +8,6 @@ ...@@ -9,18 +8,6 @@
* makes any warranty, express or implied, or assumes any liability or * makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software * responsibility for the use of this software
* *
* Visit www.amas.web.psi for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/ ***************************************************************************/
// include files // include files
...@@ -54,12 +41,10 @@ public: ...@@ -54,12 +41,10 @@ public:
for (d=3; d<Dim; ++d) for (d=3; d<Dim; ++d)
{ {
Lhs.step(d); Lhs.step(d);
// #pragma inline here
for_each(Rhs,StepFunctor(d),PETE_NullCombiner()); for_each(Rhs,StepFunctor(d),PETE_NullCombiner());
if ( ! Lhs.done(d) ) if ( ! Lhs.done(d) )
break; break;
Lhs.rewind(d); Lhs.rewind(d);
// #pragma inline here
for_each(Rhs,RewindFunctor(d),PETE_NullCombiner()); for_each(Rhs,RewindFunctor(d),PETE_NullCombiner());
} }
} while (d<Dim); } while (d<Dim);
...@@ -128,15 +113,14 @@ public: ...@@ -128,15 +113,14 @@ public:
template<unsigned Dim, class LHS, class RHS, class OP> template<unsigned Dim, class LHS, class RHS, class OP>
void BrickExpression<Dim,LHS,RHS,OP>::apply() void BrickExpression<Dim,LHS,RHS,OP>::apply()
{ {
// #pragma inline here
BrickExpLoop<LHS,RHS,OP,Dim>::apply(Lhs,Rhs,Op); BrickExpLoop<LHS,RHS,OP,Dim>::apply(Lhs,Rhs,Op);
} }
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: BrickExpression.cpp,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $ // mode:c
* IPPL_VERSION_ID: $Id: BrickExpression.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ // c-basic-offset: 4
***************************************************************************/ // indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
* *
***************************************************************************/ ***************************************************************************/
...@@ -67,6 +63,7 @@ public: ...@@ -67,6 +63,7 @@ public:
Field(Layout_t &,const GuardCellSizes<Dim>&,const BConds<T,Dim,M,C>&); Field(Layout_t &,const GuardCellSizes<Dim>&,const BConds<T,Dim,M,C>&);
Field(Layout_t &,const BConds<T,Dim,M,C>&,const GuardCellSizes<Dim>&); Field(Layout_t &,const BConds<T,Dim,M,C>&,const GuardCellSizes<Dim>&);
Field(FieldSpec<T,Dim,M,C>&); Field(FieldSpec<T,Dim,M,C>&);
constexpr Field(Field<T,Dim,M,C>&) = default;
// Constructors including a Mesh object as argument: // Constructors including a Mesh object as argument:
Field(Mesh_t&, Layout_t &); Field(Mesh_t&, Layout_t &);
...@@ -187,10 +184,12 @@ private: ...@@ -187,10 +184,12 @@ private:
#include "Field/Field.hpp" #include "Field/Field.hpp"
#endif // FIELD_H #endif
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: Field.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $ // mode:c
* IPPL_VERSION_ID: $Id: Field.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ // c-basic-offset: 4
***************************************************************************/ // indent-tabs-mode: nil
// require-final-newline: nil
// End:
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
GuardCellSizes(unsigned *s); GuardCellSizes(unsigned *s);
GuardCellSizes(unsigned l, unsigned r); GuardCellSizes(unsigned l, unsigned r);
GuardCellSizes(unsigned *l, unsigned *r); GuardCellSizes(unsigned *l, unsigned *r);
constexpr GuardCellSizes<Dim>(const GuardCellSizes<Dim>&) = default;
GuardCellSizes<Dim>& operator=(const GuardCellSizes<Dim>& gc) GuardCellSizes<Dim>& operator=(const GuardCellSizes<Dim>& gc)
{ {
for (unsigned d=0; d<Dim; ++d) { for (unsigned d=0; d<Dim; ++d) {
......
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
* *
***************************************************************************/ ***************************************************************************/
...@@ -207,6 +203,7 @@ public: ...@@ -207,6 +203,7 @@ public:
enum { Dim_u = Dim }; enum { Dim_u = Dim };
typedef IndexedBareFieldIterator<T,Dim> iterator; typedef IndexedBareFieldIterator<T,Dim> iterator;
constexpr IndexedBareField (const IndexedBareField<T, Dim, Brackets>&) = default;
IndexedBareField<T,Dim,Brackets+1> operator[](const Index& idx) IndexedBareField<T,Dim,Brackets+1> operator[](const Index& idx)
{ {
CTAssert(Brackets<Dim); CTAssert(Brackets<Dim);
...@@ -340,8 +337,10 @@ std::ostream& operator<<(std::ostream& out, const IndexedBareField<T,Dim,Bracket ...@@ -340,8 +337,10 @@ std::ostream& operator<<(std::ostream& out, const IndexedBareField<T,Dim,Bracket
#endif // INDEXED_BARE_FIELD_H #endif // INDEXED_BARE_FIELD_H
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: IndexedBareField.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $ // mode:c
* IPPL_VERSION_ID: $Id: IndexedBareField.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ // c-basic-offset: 4
***************************************************************************/ // indent-tabs-mode: nil
// require-final-newline: nil
// End:
set (_SRCS set (_SRCS
FieldLayoutUser.cpp
VRB.cpp VRB.cpp
) )
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
* This program was prepared by PSI.
* All rights in the program are reserved by PSI.
* Neither PSI nor the author(s)
* makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software
*
* Visit www.amas.web.psi for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
// include files
#include "FieldLayout/FieldLayoutUser.h"
////////////////////////////////////////////////////////////////////////
// constructor - the base class selects a unique ID value
FieldLayoutUser::FieldLayoutUser() { }
////////////////////////////////////////////////////////////////////////
// destructor, nothing to do here
FieldLayoutUser::~FieldLayoutUser() { }
/***************************************************************************
* $RCSfile: FieldLayoutUser.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:27 $
* IPPL_VERSION_ID: $Id: FieldLayoutUser.cpp,v 1.1.1.1 2003/01/23 07:40:27 adelmann Exp $
***************************************************************************/
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
* *
* The IPPL Framework * The IPPL Framework
* *
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/ ***************************************************************************/
#ifndef FIELD_LAYOUT_USER_H #ifndef FIELD_LAYOUT_USER_H
...@@ -31,10 +28,10 @@ class FieldLayoutUser : public User { ...@@ -31,10 +28,10 @@ class FieldLayoutUser : public User {
public: public:
// constructor - the base class selects a unique ID value // constructor - the base class selects a unique ID value
FieldLayoutUser(); FieldLayoutUser() {};
// destructor, nothing to do here // destructor, nothing to do here
virtual ~FieldLayoutUser(); virtual ~FieldLayoutUser() {};
// //
// virtual functions for FieldLayoutUser's // virtual functions for FieldLayoutUser's
...@@ -46,8 +43,10 @@ public: ...@@ -46,8 +43,10 @@ public:
#endif // FIELD_LAYOUT_USER_H #endif // FIELD_LAYOUT_USER_H
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: FieldLayoutUser.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:27 $ // mode:c
* IPPL_VERSION_ID: $Id: FieldLayoutUser.h,v 1.1.1.1 2003/01/23 07:40:27 adelmann Exp $ // c-basic-offset: 4
***************************************************************************/ // indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
* *
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/ ***************************************************************************/
#ifndef TAG_MAKER_H #ifndef TAG_MAKER_H
...@@ -107,3 +103,11 @@ private: ...@@ -107,3 +103,11 @@ private:
}; };
#endif // TAG_MAKER_H #endif // TAG_MAKER_H
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
...@@ -13,17 +12,6 @@ ...@@ -13,17 +12,6 @@
* *
***************************************************************************/ ***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
// include files
#include "Particle/IpplParticleBase.h" #include "Particle/IpplParticleBase.h"
#include "Particle/ParticleLayout.h" #include "Particle/ParticleLayout.h"
#include "Particle/ParticleAttrib.h" #include "Particle/ParticleAttrib.h"
...@@ -33,6 +21,7 @@ ...@@ -33,6 +21,7 @@
#include "Utility/PAssert.h" #include "Utility/PAssert.h"
#include "Utility/IpplInfo.h" #include "Utility/IpplInfo.h"
#include "Utility/IpplStats.h" #include "Utility/IpplStats.h"
#include "Utility/IpplException.h"
#include <algorithm> #include <algorithm>
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
...@@ -148,7 +137,11 @@ void IpplParticleBase<PLayout>::resetID(void) { ...@@ -148,7 +137,11 @@ void IpplParticleBase<PLayout>::resetID(void) {
Message* msg2 = new Message; Message* msg2 = new Message;
msg2->put(lp[ip]); msg2->put(lp[ip]);
bool success = Ippl::Comm->send(msg2,ip,tag2); bool success = Ippl::Comm->send(msg2,ip,tag2);
PAssert(success); if (success == false) {
throw IpplException (
"IpplParticleBase<PLayout>::resetID()",
"sending initial ID values failed.");
}
} }
// we are done // we are done
return; return;
...@@ -159,7 +152,11 @@ void IpplParticleBase<PLayout>::resetID(void) { ...@@ -159,7 +152,11 @@ void IpplParticleBase<PLayout>::resetID(void) {
Message* msg1 = new Message; Message* msg1 = new Message;
msg1->put(localNum); msg1->put(localNum);
bool success = Ippl::Comm->send(msg1,master,tag1); bool success = Ippl::Comm->send(msg1,master,tag1);
PAssert(success); if (success == false) {
throw IpplException (
"IpplParticleBase<PLayout>::resetID()",
"sending initial ID values failed.");
}
// now receive back our initial ID number // now receive back our initial ID number
size_t initialID = 0; size_t initialID = 0;
int tag2 = Ippl::Comm->next_tag(P_RESET_ID_TAG,P_LAYOUT_CYCLE); int tag2 = Ippl::Comm->next_tag(P_RESET_ID_TAG,P_LAYOUT_CYCLE);
...@@ -776,9 +773,10 @@ void IpplParticleBase<PLayout>::printDebug(Inform& o) { ...@@ -776,9 +773,10 @@ void IpplParticleBase<PLayout>::printDebug(Inform& o) {
Layout->printDebug(o); Layout->printDebug(o);
} }
// vi: set et ts=4 sw=4 sts=4:
/*************************************************************************** // Local Variables:
* $RCSfile: IpplParticleBase.cpp,v $ $Author: adelmann $ // mode:c
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $ // c-basic-offset: 4
* IPPL_VERSION_ID: $Id: IpplParticleBase.cpp,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $ // indent-tabs-mode: nil
***************************************************************************/ // require-final-newline: nil
// End:
...@@ -715,6 +715,9 @@ public: ...@@ -715,6 +715,9 @@ public:
T const * operator->() const { return getP(); } T const * operator->() const { return getP(); }
ParticleAttribConstIterator<T>& operator=(const ParticleAttribConstIterator<T>&) = default;
ParticleAttribConstIterator<T>& operator++(void) { ParticleAttribConstIterator<T>& operator++(void) {
++curr; ++curr;
return *this; return *this;
......
// -*- C++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
* *
***************************************************************************/ ***************************************************************************/
...@@ -71,6 +67,8 @@ public: ...@@ -71,6 +67,8 @@ public:
//# public enumerations //# public enumerations
enum { Dim_u = Dim }; enum { Dim_u = Dim };
constexpr SubBareField(const SubBareField<T, Dim, S>&) = default;
// Return the beginning and end iterators for this class. // Return the beginning and end iterators for this class.
iterator begin() const; iterator begin() const;
iterator end() const; iterator end() const;
...@@ -237,10 +235,12 @@ std::ostream& operator<<(std::ostream& o, const SubBareField<T,Dim,S>& s) { ...@@ -237,10 +235,12 @@ std::ostream& operator<<(std::ostream& o, const SubBareField<T,Dim,S>& s) {
#include "SubField/SubBareField.hpp" #include "SubField/SubBareField.hpp"
#endif // SUB_BARE_FIELD_H #endif
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: SubBareField.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $ // mode:c
* IPPL_VERSION_ID: $Id: SubBareField.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $ // c-basic-offset: 4
***************************************************************************/ // indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/*************************************************************************** /***************************************************************************