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

Re: [PATCH] run-command.c: Fix unused variables warning with gcc 4.6

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 27, 2011, 01:16 UTC
Message-ID
<20110427011614.GA14181@elie>
In-Reply-To
<4DB6BA5E.3040306@elegosoft.com>
Hi Michael,
Michael Schubert wrote:
> As of gcc 4.6 -Wall includes -Wunused-but-set-variable. Remove all
> unused variables to prevent those warnings.

As the other Michael mentioned, this patch replaces one warning with another. You might like a111eb7 (run-command: handle short writes and EINTR in die_child, 2011-04-20, aka jn/run-command-error-failure in "pu"), which eliminates both.

Andreas, a patch on top to short-circuit away the later writes on error doesn't sound bad to me if you'd like, though it seems like a bit of an edge case.

Thanks, all. Jonathan

Previous: Andreas Ericsson
Message 5 of 5 in “run-command.c: Fix unused variables warning with gcc 4.6”
  1. run-command.c: Fix unused variables warning with gcc 4.6Michael Schubert, Apr 26, 2011
  2. Michael J GruberApr 26, 2011
  3. Michael SchubertApr 26, 2011
  4. Andreas EricssonApr 26, 2011
  5. Jonathan NiederApr 27, 2011

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.