NOAA-OWP / ngen

Next Generation Water Modeling Engine and Framework Prototype
Other
82 stars 57 forks source link

Control flow issue in subdivide_hydrofabric #825

Open PhilMiller opened 1 month ago

PhilMiller commented 1 month ago

In commit b62389d27d57991747a02d4d954ac73b185c4afd, the logic of Python availability in subdivide_hydrofabric was changed. This created the situation where a build with MPI enabled and Python disabled would generate the following warning:

In file included from /repos/ngen/src/NGen.cpp:51:
/repos/ngen/include/utilities/parallel_utils.h: In function 'bool parallel::subdivide_hydrofabric(int, int, const string&, const string&, const string&)':
/repos/ngen/include/utilities/parallel_utils.h:536:5: warning: control reaches end of non-void function [-Wreturn-type]

I agree with the warning - in that case, the function can fail to specify its return value, leading to undefined behavior.

PhilMiller commented 1 month ago

@robertbartel