Skip to content

Prevent clang warning about unused variables in multipole.h

John Helly requested to merge clang_multipole_warning into master

Compiling swift with aocc 4.0 results in this warning:

In file included from ../../src/space_split.c:33:
../../src/multipole.h:1034:10: error: variable 'M_100' set but not used [-Werror,-Wunused-but-set-variable]
  double M_100 = 0., M_010 = 0., M_001 = 0.;
         ^
../../src/multipole.h:1034:22: error: variable 'M_010' set but not used [-Werror,-Wunused-but-set-variable]
  double M_100 = 0., M_010 = 0., M_001 = 0.;
                     ^
../../src/multipole.h:1034:34: error: variable 'M_001' set but not used [-Werror,-Wunused-but-set-variable]
  double M_100 = 0., M_010 = 0., M_001 = 0.;

This is in the function gravity_P2M. The M_100, M_010, M_001 variables are accumulated to but then the result is never used. I think we can just comment out the declarations and updates.

Merge request reports