Commit 4ede6d7a authored by gsell's avatar gsell
Browse files

cleanup: fix GCC 9.2 warnings and some cleanup

parent 269b7b0d
...@@ -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
......
// -*- 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 = T(0);
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
) )
......
...@@ -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:
...@@ -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++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
* *
***************************************************************************/ ***************************************************************************/
...@@ -73,8 +69,10 @@ SUB_ASSIGNMENT_OPERATORS(maxeq,OpMaxAssign) ...@@ -73,8 +69,10 @@ SUB_ASSIGNMENT_OPERATORS(maxeq,OpMaxAssign)
#endif // SUB_FIELD_ASSIGN_H #endif // SUB_FIELD_ASSIGN_H
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: SubFieldAssign.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $ // mode:c
* IPPL_VERSION_ID: $Id: SubFieldAssign.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++ -*-
/*************************************************************************** /***************************************************************************
* *
* The IPPL Framework * The IPPL Framework
* *
* ***************************************************************************/
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef PASSERT_H #ifndef PASSERT_H
#define PASSERT_H #define PASSERT_H
...@@ -57,17 +53,11 @@ public: ...@@ -57,17 +53,11 @@ public:
assertion( const char *cond, const char *file, int line ); assertion( const char *cond, const char *file, int line );
assertion( const char *m ); assertion( const char *m );
assertion( const assertion& a ); assertion( const assertion& a );
~assertion() throw() { delete[] msg; } ~assertion() throw() { delete[] msg; }
assertion& operator=( const assertion& a ); assertion& operator=( const assertion& a );
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
const char* what() { return msg; }
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
using std::runtime_error::what;
virtual const char* what() { return msg; };
}; };
//---------------------------------------------------------------------------// //---------------------------------------------------------------------------//
...@@ -143,8 +133,10 @@ void insist( const char *cond, const char *msg, const char *file, int line ); ...@@ -143,8 +133,10 @@ void insist( const char *cond, const char *msg, const char *file, int line );
#endif // PASSERT_H #endif // PASSERT_H
/*************************************************************************** // vi: set et ts=4 sw=4 sts=4:
* $RCSfile: PAssert.h,v $ $Author: adelmann $ // Local Variables:
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $ // mode:c
* IPPL_VERSION_ID: $Id: PAssert.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++ -*- /******************************************************************************
/**************************************************************************************************************************************
* *
* The IPPL Framework * The IPPL Framework
* *
...@@ -14,7 +13,7 @@ ...@@ -14,7 +13,7 @@
* epsilon is the softening parameter, printSteps=10 prints every tenth step * epsilon is the softening parameter, printSteps=10 prints every tenth step
* *
* *
*************************************************************************************************************************************/ ******************************************************************************/
#include "Ippl.h" #include "Ippl.h"
#include <cassert> #include <cassert>
#include <string> #include <string>
...@@ -473,10 +472,6 @@ class ChargedParticles : public IpplParticleBase<PL> { ...@@ -473,10 +472,6 @@ class ChargedParticles : public IpplParticleBase<PL> {
H5f_m = H5OpenFile(fn.c_str(), H5_O_WRONLY, props); H5f_m = H5OpenFile(fn.c_str(), H5_O_WRONLY, props);
} }
inline double getEFDMag(int x, int y, int z) {
return eg_m[x][y][z].get();
}
const Vector_t get_hr() { return hr_m; } const Vector_t get_hr() { return hr_m; }
...@@ -783,4 +778,12 @@ int main(int argc, char *argv[]){ ...@@ -783,4 +778,12 @@ int main(int argc, char *argv[]){
delete mesh; delete mesh;
return 0; return 0;
} }
\ No newline at end of file
// 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:
...@@ -23,7 +23,6 @@ int main(int argc, char *argv[]) { ...@@ -23,7 +23,6 @@ int main(int argc, char *argv[]) {
const unsigned D=3U; const unsigned D=3U;
double hightail; double hightail;
unsigned int d; unsigned int d;
int tag = Ippl::Comm->next_tag(tag);
unsigned ngrid[D]; // grid sizes sizes unsigned ngrid[D]; // grid sizes sizes
unsigned int iters = 100; unsigned int iters = 100;