widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #10874
Re: [Merge] lp:~widelands-dev/widelands/bug-986611-cppcheck-uninitialized-variables into lp:widelands
> Well, it's just the same as initializing numbers to 0 - cppcheck is complaining, so I'm trying to get rid of that noise in the report.
That would be wrong though - plain old datatypes (POD) are not initialized in cpp, so numbers are indeed a random value if not properly initialized. std::string is a class, not a POD though so its constructor is always run. If cppcheck complains about this it would be wrong. I wonder if it is worthwhile to clutter the code with unnecessary (and for std::string even slightly decremental) changes to appease the tool.
--
https://code.launchpad.net/~widelands-dev/widelands/bug-986611-cppcheck-uninitialized-variables/+merge/326256
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-986611-cppcheck-uninitialized-variables.
References