ncsu-landscape-dynamics / pops-core

PoPS Core: C++ library for the Pest or Pathogen Spread Model
https://ncsu-landscape-dynamics.github.io/pops-core
GNU General Public License v2.0
5 stars 2 forks source link

Add float conversion warning to compile options #216

Closed wenzeslaus closed 6 months ago

wenzeslaus commented 6 months ago

Fail compilation when a compiler (GCC or Clang) warning is issued. The original motivation is catching -Wfloat-conversion in CI since we invested into fixing it.

wenzeslaus commented 6 months ago

The compilation in CI now fails with:

 /home/runner/work/pops-core/pops-core/include/pops/actions.hpp:95:42: error: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Werror,-Wfloat-conversion]

which is good because it means that the check and CI works. The errors will be fixed by the float-conversion-related PRs which are now open. After these are merged, this can be merged.

wenzeslaus commented 6 months ago

The CI now passes. This will fail builds in CI and locally if there is a compiler (GCC or Clang) warning (from those enabled: -Wall -Wextra -pedantic -Wfloat-conversion). This applies only to building tests in this repo and does not influence rpops or r.pops.spread.