From: Erik Faye-Lund Date: Thu, 21 Mar 2013 15:16:00 GMT Subject: Re: [PATCH 3/4] drop some obsolete "x = x" compiler warning hacks Message-ID: In-Reply-To: <20130321111028.GC18819@sigill.intra.peff.net> On Thu, Mar 21, 2013 at 12:10 PM, Jeff King wrote: > In cases where the setting and access of a variable are > protected by the same conditional flag, older versions of > gcc would generate a "might be used unitialized" warning. We > silence the warning by initializing the variable to itself, > a hack that gcc recognizes. > > Modern versions of gcc are smart enough to get this right, > going back to at least version 4.3.5. gcc 4.1 does get it > wrong in both cases, but is sufficiently old that we > probably don't need to care about it anymore. > > Signed-off-by: Jeff King > --- > gcc 4.2 is conspicuously missing because no current Debian system even > has a backwards-compatibility package for it, making it harder to test. > And 4.3 was old enough for me to say "I do not care if you can run with > -Wall -Werror or not", let alone 4.2. Just a data-point. This is the version we use in msysGit: $ gcc --version gcc.exe (TDM-1 mingw32) 4.4.0 So yeah, it's not going to increase false positives here, I guess.