danieljprice / phantom

Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
https://phantomsph.github.io
Other
108 stars 239 forks source link

disallow new compiler warnings when merging pull requests #349

Closed danieljprice closed 1 year ago

danieljprice commented 1 year ago

it's easier to spot genuine errors if there are no warnings emitted when compiling phantom. Ideally the aim should be to keep the master branch `clean', i.e. compiling with no warnings where possible

in principle this could be enforced in the build actions by adding the -Werror flag, but this should not be on in the Makefile by default as blocks the compilation of otherwise perfectly acceptable code while developing/debugging

progress towards this involves:

  1. eliminating all existing compiler warnings on the master branch
  2. ensuring that phantom can be compiled successfully with -Werror, at least with fortran
  3. checking this across all builds
  4. eventually enforcing this in the actions (maybe as a non-mandatory check?)

One issue is that some warnings are hard to suppress or are caused by internal compiler issues, e.g. warnings about unused variables with .ubound etc on allocatable arrays

danieljprice commented 1 year ago

now implemented and live!