Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add float conversion warning to compile options #216

Merged
merged 2 commits into from
Mar 13, 2024
Merged

Conversation

wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Mar 7, 2024

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
Copy link
Member Author

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 wenzeslaus added the enhancement New feature or request label Mar 7, 2024
@wenzeslaus wenzeslaus added this to the 3.0.0 milestone Mar 7, 2024
@wenzeslaus wenzeslaus force-pushed the more-strict-compile branch from 3dfc183 to d357bd2 Compare March 12, 2024 15:38
@wenzeslaus wenzeslaus marked this pull request as ready for review March 12, 2024 15:41
@wenzeslaus
Copy link
Member Author

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.

@wenzeslaus wenzeslaus merged commit 0506eae into main Mar 13, 2024
9 checks passed
@wenzeslaus wenzeslaus deleted the more-strict-compile branch March 13, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant