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

Re: [PATCH 2/2] Actually use retval

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 22, 2011, 18:20 UTC
Message-ID
<alpine.DEB.1.00.1103221918540.1561@bonsai2>
In-Reply-To
<7v7hbrkovz.fsf@alter.siamese.dyndns.org>
Hi,
On Tue, 22 Mar 2011, Junio C Hamano wrote:
Show 6 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> 
> > This is most likely a bug. Nocited by gcc 4.6.0.
> 
> While I don't doubt gcc 4.6.0 found the retval assigned is not used, I 
> think you misunderstood the value returned from this function.

Nope. I did not misunderstand. I did not understand in the first place. That is what I described pretty explicitly in the cover letter.

Show 9 quoted lines
> The caller uses the return value to decide if an entry from t1 (and not 
> from t2) was consumed, if an entry each from both t1 and t2 were 
> consumed, or an entry from t2 (and not from t1) was consumed.  It 
> doesn't change the fact that the entry at the beginning of each tree we 
> looked at in this function at that point shared the same name and we 
> consumed them, whatever the call to diff_tree_sha1() to run a recursive 
> comparison between the trees found.
> 
> The likely fix would be to remove assignment to retval instead.
Thanks, that is the alternative I suggested after the dashdashdash.

Ciao, Johannes

Previous: Junio C HamanoNext: Jonathan Nieder
Message 8 of 11 in “Fix issues found by gcc 4.6.0”
  1. 0/2 Fix issues found by gcc 4.6.0Johannes Schindelin, Mar 22, 2011
  2. 1/2 Remove unused variablesJohannes Schindelin, Mar 22, 2011
  3. Junio C HamanoMar 22, 2011
  4. Johannes SchindelinMar 22, 2011
  5. Jonathan NiederMar 22, 2011
  6. 2/2 Actually use retvalJohannes Schindelin, Mar 22, 2011
  7. Junio C HamanoMar 22, 2011
  8. Johannes SchindelinMar 22, 2011
  9. 0/2 Re: [PATCH 2/2] Actually use retvalJonathan Nieder, Mar 23, 2011
  10. 1/2 tree-diff: make diff_tree return voidJonathan Nieder, Mar 23, 2011
  11. 2/2 tree-diff: make diff_tree_sha1 return voidJonathan Nieder, Mar 23, 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.