Subject: Re: [PATCH/RFC] reflog: silence -O3 -Wuninitialized warning

From: Jonathan Nieder <[email-masked]>
Date: Wed, 16 Mar 2011 04:47:03 -0500

Johannes Sixt wrote:

> 	unsigned long expire = 0;

The main downside is that that prevents valgrind from discovering when
the variable really is used uninitialized.  But I do agree that

	unsigned long expire = expire;

is ugly, which is part of why I did not use the latter workaround in
this patch.

Since the makefile already controls what options are passed to msvc,
is there some simple way to suppress the warning from "expire =
expire"?  If not, I would find it tempting to make this and similar
examples look like "unsigned long expire;", treat the warning as
evidence that either

 - the code is too complicated or does not give sufficient hints
   to the compiler about control flow, or
 - the compiler has a bug

and use -Wno-uninitialized for -Werror builds.