OpenPHDGuiding / phd2

PHD2 Guiding
https://openphdguiding.org
BSD 3-Clause "New" or "Revised" License
244 stars 111 forks source link

Fix few issues with random state of uninitialized variables. #1164

Closed Eyeke2 closed 5 months ago

Eyeke2 commented 5 months ago

While it's not fixing all cases of uninitialized variables, it fixes a few of them.

agalasso commented 5 months ago

Having un-referenced data uninitialized is a common idiom in this codebase and the libraries we use (STL and wxWidgets) and we're not going to start changing that now. Examples: any POD data type declared on the stack without an initializer, lots of stl and wxWidgets container types like std::vector, wx vector type instances, buffers allocated with malloc etc etc. Seeing as we agree this pr is just implementing your personal preference in a couple places to have some unreferenced data initialized to zero, and not fixing any issue where uninitialized data is actually referenced, I'm going to close this. If you have some cases where code references uninitialized data then by all means let's fix them.

Eyeke2 commented 5 months ago

Ok, I don't mind. it just seems there are redundant places in code which test if pGuider is not a NULL pointer, which will remain questionable.