git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix an "variable might be used uninitialized" gcc warning

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Dec 17, 2011, 10:22 UTC
Message-ID
<m2iplffqgg.fsf@igel.home>
In-Reply-To
<20111216235908.GA5858@elie.hsd1.il.comcast.net>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 13 quoted lines
> Ramsay Jones wrote:
>
>>         CC builtin/checkout.o
>>     builtin/checkout.c: In function `cmd_checkout':
>>     builtin/checkout.c:160: warning: 'mode' might be used uninitialized \
>>         in this function
> [...]
>> [Note that only 2 out of the 3 versions of gcc I use issues this
>> warning]
>
> Which version of gcc is that?  Is gcc getting more sane, so we won't
> have to worry about this after a while, or is the false positive a
> new regression that should be reported to them?

The regression is that the function has been changed in a way that makes it impossible to infer the intended flow.

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Jonathan NiederNext: Ramsay Jones
Message 3 of 7 in “Fix an "variable might be used uninitialized" gcc warning”
  1. Fix an "variable might be used uninitialized" gcc warningRamsay Jones, Dec 16, 2011
  2. Jonathan NiederDec 16, 2011
  3. Andreas SchwabDec 17, 2011
  4. Ramsay JonesJan 31, 2012
  5. Jonathan NiederJan 31, 2012
  6. Miles BaderFeb 1, 2012
  7. Ramsay JonesFeb 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.