3 ms·
"Adding insult to injury, one of the most common cases is an uninitialized variable." Somebody needs to turn on compiler warnings!
by cdcarter 15y ago
"Adding insult to injury, one of the most common cases is an uninitialized variable."
Somebody needs to turn on compiler warnings!
- nhaehnle 15y ago... and run Valgrind (or equivalent) occasionally. We're using the parallel simulation technique in Widelands. Only using integer arithmetic, compiling with -Wall and running Valgrind occasionally has kept us very safe. The only recent cases of desync I can remember is when either (a) somebody added a new feature and messed up the network protocol (which is usually very obvious because the desync happens just after the new feature is invoked) and (b) somebody new to the code uses a std::set<Foo*> to iterate over a collection of objects. Basing simulation decisions on pointer values is a bad idea.