coin-or / Clp

COIN-OR Linear Programming Solver
Other
392 stars 82 forks source link

Initialize variables for presolve to prevent MSVS error C4703 #287

Closed jhmgoossens closed 5 months ago

jhmgoossens commented 5 months ago

Fix for error/warning C4703 for MSVS builds: Potentially uninitialized local pointer variable used for flags, maxdown and maxup.

The original code initializes flags, maxdown and maxup only "if(takeOutSome)", and only uses these variables under the same condition (good). Unfortunately, the MSVS linker still believes this is potentially wrong--which is incorrect. Due to other linker options (/sdl), these (erroneous) warnings are treated as errors and therefore stop the build. The easiest way to workaround this is to initialize the variables.