Re: [PATCH 3/4] drop some obsolete "x = x" compiler warning hacks
- From
Erik Faye-Lund <kusmabite@gmail.com>
- Date
- Mar 21, 2013, 15:16 UTC
- Message-ID
- <CABPQNSadzAFqJq8=zi36BdL9Qcoi-WsoEj0yhdAZ4GvvkyHfVQ@mail.gmail.com>
- In-Reply-To
- <20130321111028.GC18819@sigill.intra.peff.net>
On Thu, Mar 21, 2013 at 12:10 PM, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> 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 <peff@peff.net> > --- > 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.