On Fri, 24 Aug 2012 12:20:58 -0700, Justin Lebar wrote: >> inline int32_t GetFoo() { >> int32_t result = 0; >> nsresult rv = GetFoo(&result); >> MOZ_ASSERT(NS_SUCCEEDED(rv)); >> return result; >> } > > so that we never return uninitialized memory in release builds. 0 may > or may not be right, but it should be no worse than a random value!
Initialization to a meaningless value is worse because it means that valgrind (and perhaps other analysis tools) won't detect when GetFoo is misbehaving. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform