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. --- .../FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H') diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H index a4a94c535..d8f057a70 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianYeeAlgorithm.H @@ -90,6 +90,7 @@ struct CartesianYeeAlgorithm { #if defined WARPX_DIM_3D Real const inv_dy = coefs_y[0]; return inv_dy*( F(i,j+1,k,ncomp) - F(i,j,k,ncomp) ); + amrex::ignore_unused(n_coefs_y); #elif (defined WARPX_DIM_XZ) amrex::ignore_unused(F, coefs_y, n_coefs_y, i, j, k, ncomp); @@ -112,6 +113,7 @@ struct CartesianYeeAlgorithm { #if defined WARPX_DIM_3D Real const inv_dy = coefs_y[0]; return inv_dy*( F(i,j,k,ncomp) - F(i,j-1,k,ncomp) ); + amrex::ignore_unused(n_coefs_y); #elif (defined WARPX_DIM_XZ) amrex::ignore_unused(F, coefs_y, n_coefs_y, i, j, k, ncomp); -- cgit v1.2.3