inverse-inc/sogo — pull request #33 by dekkers (2014-04-11 14:31:35+00:00)
Title: Fix "may be used uninitialized in this function" warnings

This fixes all the "may be used uninitialized in this function" warnings in the OpenChange directory, so it compiles with -O2 and the default -Werror. The problems are detected in the optimizer and because of that the warnings aren't emitted when compiled without optimization. Aparently the OpenChange backend has never been compiled with optimization, but if you run configure with --disable-debug you will get the errors (see my next pull request to change the default).

In most cases I could change the code in a way that gcc can figure out the variable is initialized, but in a few cases gcc is either not smart enough or the code is too complex that gcc will never figure out that the variable is always initialized. In those cases I choosed to silence the warning by explicitly initializing the variable so we can continue to threat these warnings as errors, because sometimes the variable really is used uninitialized in some specific code path. This was the case with rc in MAPIStoreMailFolder.m and childFolder in MAPIStoreFolder.m for example.

There are some further comments about individual fixes in the diff.