Re: /* compiler workaround */ - what was the issue?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 5, 2016, 21:41 UTC
- Message-ID
- <xmqqtwic9o88.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <17E04501C9474282B87758C7998A1F5B@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 8 quoted lines
> int saved_namelen = saved_namelen; /* compiler workaround */ > > Which then becomes an MSVC compile warning C4700: uninitialized local > variable. > > I'm wondering what was the compiler workaround being referred to? i.e. why > does it need that tweak? There's no mention of the reason in the commit > message.
That was a fairly well-known workaround for GCC that issues a false warning that variable is used before initialized. I thought we stopped using it several years ago in new code after doing a bulk sanitizing (I think the new recommended workaround was to initialise such a variable to the nil value like '0' for integers).