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

Re: [PATCH] parse-options: fix clang opterror() -Wunused-value warning

From
Jeff King <peff@peff.net>
Date
Aug 9, 2013, 10:32 UTC
Message-ID
<20130809103249.GA18878@sigill.intra.peff.net>
In-Reply-To
<1376039177-17560-1-git-send-email-sunshine@sunshineco.com>
On Fri, Aug 09, 2013 at 05:06:17AM -0400, Eric Sunshine wrote:
Show 13 quoted lines
> a469a1019352b8ef (silence some -Wuninitialized false positives;
> 2012-12-15) triggered "unused value" warnings when the return value of
> opterror() and several other error-related functions was not used.
> 5ded807f7c0be10e (fix clang -Wunused-value warnings for error functions;
> 2013-01-16) applied a fix by adding #if !defined(__clang__) in cache.h
> and git-compat-util.h, but misspelled it as #if !defined(clang) in
> parse-options.h. Fix this.
> 
> This mistake went unnoticed because existing callers of opterror()
> utilize its return value.  1158826394e162c5 (parse-options: add
> OPT_CMDMODE(); 2013-07-30), however, adds a new invocation of opterror()
> which ignores the return value, thus triggering the "unused value"
> warning.
Oops.

Patch looks obviously correct. Thanks for a nice explanation of what happened.

-Peff
Previous: Eric Sunshine
Message 2 of 2 in “parse-options: fix clang opterror() -Wunused-value warning”
  1. parse-options: fix clang opterror() -Wunused-value warningEric Sunshine, Aug 9, 2013
  2. Jeff KingAug 9, 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.