Mismatch between const float and float in runner_iact_rt_inject in SPHM1RT
There is a mismatch in runner_iact_rt_inject between src/rt/SPHM1RT/rt_iact.h and runner_doiact_functions_stars.h.
The solution is to change "float dx[3]" to "const float dx[3]" in the argument of runner_iact_rt_inject in src/rt/SPHM1RT/rt_iact.h
To reproduce this:
./configure --with-rt=SPHM1RT_4 --with-hydro=sphenix --with-sundials=/cosma/local/sundials/5.1.0
make
po -c runner_recv.c -o libswiftsim_la-runner_recv.o
mv -f .deps/libswiftsim_la-runner_recv.Tpo .deps/libswiftsim_la-runner_recv.Plo
/bin/sh ../libtool --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I/cosma/local/hdf5//intel_2024.2.0/1.14.4/include -I/cosma/local/gsl/2.8/include -I/cosma/local/parmetis/intel_2024.2.0_intel_mpi_2024.2.0/4.0.3-64bit/include -I/cosma/local/fftw//intel_2024.2.0_intel_mpi_2024.2.0/3.3.10/include -I/cosma/local/ucx/1.17.0/include -I/cosma/local/hdf5/intel_2024.2.0/1.14.4/include -I/cosma/local/software/hdf5/build/intel_2024.2.0/1.14.4/src/src/H5FDsubfiling -isystem/cosma/local/sundials/5.1.0/include -ipo -O3 -ansi-alias -fma -ftz -fomit-frame-pointer -march=core-avx2 -mavx2 -Qunused-arguments -pthread -Wall -Wextra -Wno-unused-parameter -Wshadow -Werror -Wstrict-prototypes -MT libswiftsim_la-runner_pack.lo -MD -MP -MF .deps/libswiftsim_la-runner_pack.Tpo -c -o libswiftsim_la-runner_pack.lo `test -f 'runner_pack.c' || echo './'`runner_pack.c
In file included from runner_doiact_stars.c:46:
./runner_doiact_functions_stars.h:174:35: error: passing 'const float[3]' to parameter of type 'float *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
174 | runner_iact_rt_inject(r2, dx, hi, hj, si, pj, a, H, e->rt_props);
| ^~
././rt/SPHM1RT/rt_iact.h:103:27: note: passing argument to parameter 'dx' here
103 | const float r2, float dx[3], const float hi, const float hj,
| ^
In file included from runner_doiact_stars.c:46:
./runner_doiact_functions_stars.h:339:35: error: passing 'const float[3]' to parameter of type 'float *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
339 | runner_iact_rt_inject(r2, dx, hi, hj, si, pj, a, H, e->rt_props);
| ^~
././rt/SPHM1RT/rt_iact.h:103:27: note: passing argument to parameter 'dx' here
103 | const float r2, float dx[3], const float hi, const float hj,
| ^
In file included from runner_doiact_stars.c:46:
./runner_doiact_functions_stars.h:566:37: error: passing 'const float[3]' to parameter of type 'float *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
566 | runner_iact_rt_inject(r2, dx, hi, hj, spi, pj, a, H, e->rt_props);
| ^~
././rt/SPHM1RT/rt_iact.h:103:27: note: passing argument to parameter 'dx' here
103 | const float r2, float dx[3], const float hi, const float hj,
| ^
In file included from runner_doiact_stars.c:46:
./runner_doiact_functions_stars.h:730:37: error: passing 'const float[3]' to parameter of type 'float *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
730 | runner_iact_rt_inject(r2, dx, hj, hi, spj, pi, a, H, e->rt_props);
| ^~
././rt/SPHM1RT/rt_iact.h:103:27: note: passing argument to parameter 'dx' here
103 | const float r2, float dx[3], const float hi, const float hj,
| ^
4 errors generated.
make[3]: *** [Makefile:2449: libswiftsim_la-runner_doiact_stars.lo] Error 1
Edited by Tsang Keung Chan