mrc-ide / covid-sim

This is the COVID-19 CovidSim microsimulation model developed by the MRC Centre for Global Infectious Disease Analysis hosted at Imperial College, London.
GNU General Public License v3.0
1.23k stars 256 forks source link

Initialize ModelValue properly in CovidSim.cpp #465

Closed krook1024 closed 3 years ago

krook1024 commented 3 years ago

The compiler probably handles it, but let us be on the safe side.

e4lam commented 3 years ago

The compiler probably handles it, but let us be on the safe side.

No, absolutely not. The compiler will NOT handle this. C++ does not work that way. You might be lucky that it's usually zero just because of the way OSes work but make no mistake: this initialization is needed for correctness.

weshinsley commented 3 years ago

Thank you - good spot