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

Re: [PATCH 4/6] prefix_filename: return newly allocated string

From
Jeff King <peff@peff.net>
Date
Mar 21, 2017, 23:32 UTC
Message-ID
<20170321233159.usottyq56ygo26kf@sigill.intra.peff.net>
In-Reply-To
<20170321182335.3yrjkhk4mxhso73j@sigill.intra.peff.net>
On Tue, Mar 21, 2017 at 02:23:35PM -0400, Jeff King wrote:
Show 8 quoted lines
> > worktree.c:265:6: error: to_free may be used uninitialized in this function
> 
> Doh. I had originally written it without the "if (prefix)" and added it
> as a micro-optimization at the end.
> 
> Still, the whole thing compiles fine for me. I find it odd that neither
> gcc nor clang notices the problem on my system. It's quite obviously
> wrong.

Ah, I found it; it is only triggered with -O2. I usually compile with -O0 during my edit/compile/test cycles.

-Peff
Previous: Jeff KingNext: Jeff King
Message 8 of 11 in “prefix_filename cleanups”
  1. 0/6 prefix_filename cleanupsJeff King, Mar 21, 2017
  2. 1/6 hash-object: fix buffer reuse with --path in a subdirectoryJeff King, Mar 21, 2017
  3. 2/6 prefix_filename: move docstring to header fileJeff King, Mar 21, 2017
  4. 3/6 prefix_filename: drop length parameterJeff King, Mar 21, 2017
  5. 4/6 prefix_filename: return newly allocated stringJeff King, Mar 21, 2017
  6. Junio C HamanoMar 21, 2017
  7. Jeff KingMar 21, 2017
  8. Jeff KingMar 21, 2017
  9. 5/6 prefix_filename: simplify windows #ifdefJeff King, Mar 21, 2017
  10. 6/6 bundle: use prefix_filename with bundle pathJeff King, Mar 21, 2017
  11. Junio C HamanoMar 21, 2017

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.