NOAA-OWP / evapotranspiration

Other
3 stars 9 forks source link

Fix mistaken non-calls to exit() #34

Closed PhilMiller closed 6 months ago

PhilMiller commented 6 months ago

In C, exit; is not an effective statement - it just evaluates the pointer to the function exit(), rather than calling it. This was probably a relic of porting code from Fortran. I noticed a compiler warning about this.

Changes

Testing

This is in error handling code, which is not tested (AFAIK)

Screenshots

[  7%] Building C object /repos/ngen/extern/evapotranspiration/evapotranspiration/cmake_build/CMakeFiles/petbmi.dir/src/pet.c.o
/repos/ngen/extern/evapotranspiration/evapotranspiration/src/pet.c:433:9: warning: expression result unused [-Wunused-value]
        exit;
        ^~~~
/repos/ngen/extern/evapotranspiration/evapotranspiration/src/pet.c:462:9: warning: expression result unused [-Wunused-value]
        exit;
        ^~~~

Checklist

PhilMiller commented 6 months ago

@aaraney @madMatchstick Could one of you please review and merge this? I can't add reviewers myself