From 3a8a549cca10a018c3731115b86b8bff55a1a8ef Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 1 Sep 2020 08:20:47 +0200 Subject: Fix 🩹 (almost) all warnings ⚠️ with default configuration (DIM=3, openMP+MPI, double precision, no advanced solvers, no QED, native output) (#1263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR should fix almost all the compilation warnings in the default configuration (DIM=3, openMP+MPI, double precision, no advanced solvers, no QED, native output...). Or at least it does that on my system (my compiler is `g++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0` ). I have just two residual warnings: ### 1 ``` [ 89%] Building CXX object CMakeFiles/WarpX.dir/Source/Parser/wp_parser.lex.cpp.o wp_parser.lex.c:1356:17: warning: ‘void yyunput(int, char*)’ defined but not used [-Wunused-function] ``` I don't know if `yyunput(int, char*)` is there for a reason, even if it is not used. So I didn't do anything. ### 2 ``` [ 96%] Building CXX object CMakeFiles/WarpX.dir/Source/Utils/CoarsenIO.cpp.o /home/luca/Projects/warpx_dir/WarpX/Source/Particles/WarpXParticleContainer.cpp: In member function ‘void WarpXParticleContainer::AddNParticles(int, int, const ParticleReal*, const ParticleReal*, const ParticleReal*, const ParticleReal*, const ParticleReal*, const ParticleReal*, int, const ParticleReal*, int, int)’: /home/luca/Projects/warpx_dir/WarpX/Source/Particles/WarpXParticleContainer.cpp:102:44: warning: unused parameter ‘nattr’ [-Wunused-parameter] 102 | int nattr, const ParticleReal* attr, int uniqueparticles, int id) ``` The first line of `AddNParticles` is `BL_ASSERT(nattr == 1); //! @fixme nattr is unused below: false sense of safety` . So I thought that there might be something to fix here and I didn't do anything. --- Source/Particles/PhysicalParticleContainer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/Particles/PhysicalParticleContainer.cpp') diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index ac4fd0d79..8d47c14db 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -24,6 +24,7 @@ #include "Utils/WarpXAlgorithmSelection.H" #include +#include #ifdef WARPX_USE_OPENPMD # include @@ -441,6 +442,9 @@ PhysicalParticleContainer::AddPlasmaFromFile(ParticleReal q_tot, particle_ux.dataPtr(), particle_uy.dataPtr(), particle_uz.dataPtr(), 1, particle_w.dataPtr(),1); #endif // WARPX_USE_OPENPMD + + ignore_unused(q_tot, z_shift); + return; } @@ -1427,7 +1431,6 @@ PhysicalParticleContainer::PushP (int lev, Real dt, const FArrayBox& bzfab = Bz[pti]; const auto getPosition = GetParticlePosition(pti); - auto setPosition = SetParticlePosition(pti); const auto getExternalE = GetExternalEField(pti); const auto getExternalB = GetExternalBField(pti); -- cgit v1.2.3