stochasticHydroTools / SlenderBody

Slender-body hydrodynamics
11 stars 4 forks source link

Valiables may be used before initialization #3

Closed RaulPPelaez closed 2 years ago

RaulPPelaez commented 2 years ago

https://github.com/stochasticHydroTools/SlenderBody/blob/6a29cc60c32a1bb9d98dfb3b84630ca89a7ee74d/Python/cppmodules/SpecialQuadratures.cpp#L61

There should be an "else" clause here:

https://github.com/stochasticHydroTools/SlenderBody/blob/6a29cc60c32a1bb9d98dfb3b84630ca89a7ee74d/Python/cppmodules/SpecialQuadratures.cpp#L68-L77

Or alternatively, initialize imin1,2 to some default, harmless, value. Even if the situation is impossible, it shuts up compiler warnings.

omaxian commented 2 years ago

Ok, situation impossible but I initialized to 0 to stop the warnings.