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

Re: [PATCH 2/2] cat-file: Fix an gcc -Wuninitialized warning

From
Jeff King <peff@peff.net>
Date
Mar 28, 2013, 19:02 UTC
Message-ID
<20130328190226.GB17178@sigill.intra.peff.net>
In-Reply-To
<5154908B.1040801@ramsay1.demon.co.uk>
On Thu, Mar 28, 2013 at 06:48:43PM +0000, Ramsay Jones wrote:
Show 6 quoted lines
> > I'm OK with this, if it's the direction we want to go. But I thought the
> > discussion kind of ended as "we do not care about these warnings on
> > ancient versions of gcc; those people should use -Wno-error=uninitialized".
> 
> Hmm, I don't recall any agreement or conclusions being reached.
> I guess I missed that!

I think Jonathan said that and nobody disagreed, and I took it as a conclusion.

> Hmm, so are you saying that this patch is not acceptable because
> I used a compiler that is no longer supported?

No, I just think we should come to a decision on how unreadable to make the code in order to suppress incorrect warnings on old compilers. I can see the point in either of the following arguments:

  1. These compilers are old, and we do not need to cater to them in the
     code because people can just _not_ set -Werror=uninitialized (or
     its equivalent). It is still worth catering to bugs in modern
     compilers that most devs use, because being able to set -Werror is
     helpful.
  2. The code is not made significantly less readable, especially if you
     put in a comment, so why not help these compilers.

When we can make the code more readable _and_ help the compiler, I think it is a no-brainer. I am on the fence otherwise and don't care that much. I just think we should apply the rule consistently.

-Peff
Previous: Ramsay JonesNext: Jonathan Nieder
Message 5 of 6 in “cat-file: Fix an gcc -Wuninitialized warning”
  1. 2/2 cat-file: Fix an gcc -Wuninitialized warningRamsay Jones, Mar 26, 2013
  2. Jeff KingMar 26, 2013
  3. Jeff KingMar 26, 2013
  4. Ramsay JonesMar 28, 2013
  5. Jeff KingMar 28, 2013
  6. Jonathan NiederMar 28, 2013

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.