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

Re: [PATCH 3/3] Correct conditions to free textconv result data

From
Jeff King <peff@peff.net>
Date
Feb 22, 2016, 23:25 UTC
Message-ID
<20160222232544.GA10362@sigill.intra.peff.net>
In-Reply-To
<xmqqfuwk4a3y.fsf@gitster.mtv.corp.google.com>
On Mon, Feb 22, 2016 at 03:08:01PM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> > The only thing common in this series is it's the result of
> > -Wwrite-strings. 1/3 changes some "char *" to "const char *", you
> > don't miss anything.
> 
> While reading Peff's clarification patch, I did find the assignment
> of "" to the *out pointer disturbing.  That part of your patch (I
> presume that is what you mean by the above) may want to be revived.

That part was inherited from diff_populate_filespec, though it casts explicitly to "char *" since d2543b8 (Clean up diff.c, 2006-06-24). I guess we could do the same here (not that it makes things any safer, but at least tells everyone "yes, I _know_ this is weird".

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 8 of 10 in “diff.c: remove unnecessary typecast”
  1. 2/3 diff.c: remove unnecessary typecastNguyễn Thái Ngọc Duy, Feb 22, 2016
  2. 3/3 Correct conditions to free textconv result dataNguyễn Thái Ngọc Duy, Feb 22, 2016
  3. Duy NguyenFeb 22, 2016
  4. Jeff KingFeb 22, 2016
  5. Jeff KingFeb 22, 2016
  6. Duy NguyenFeb 22, 2016
  7. Junio C HamanoFeb 22, 2016
  8. Jeff KingFeb 22, 2016
  9. diff: clarify textconv interfaceJeff King, Feb 22, 2016
  10. Duy NguyenFeb 22, 2016

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.