On Tue, Jun 19, 2012 at 01:27:58AM +0200, Joerg Sonnenberger wrote:
> On Mon, Jun 18, 2012 at 07:03:05PM -0400, Greg Troxel wrote:
> > Any objections to me adding the NULL assignment?
> That's exactly the reason why I don't like GCC's -Wuninitialize.
> If code changes, changes are always that a real bug slipped through.
The uninitialised variable warnings often do show up bugs, and
blanket initialisations of variables to 0 or NULL can just stop
the compiler finding bugs for you.
gcc is better than some compilers for tracking 'paired' variables,
but there are some troublesome constructs - especially when it has
tracked use through a static function.
Sometimes it is worth simplifyingthe code to get rid of a 'boolean'
flag associated with the validitity of a pointer - use NULL instead.