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

Re: [PATCH] Remove unused assignments

From
Benjamin Kramer <benny.kra@googlemail.com>
Date
Mar 14, 2009, 20:57 UTC
Message-ID
<49BC1A29.60503@googlemail.com>
In-Reply-To
<7v7i2rc0zp.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 9 quoted lines
> 
> Thanks.  I eyeballed all of them and they look safe, but this patch made
> me wonder...
> 
> Did you use some dataflow analysis tool to spot these?
> 
> It will never scale if a human has to sanity check output from a
> mechanical process like this patch, especially when the human is already a
> chokepoint of the whole process (i.e. the maintainer).
Yep, they were found with a little help of the clang static analyzer
http://clang.llvm.org/StaticAnalysis.html

It is in early stages of development so it may report false positives and it chokes on some files. Here is the latest output I have, with my patch applied:

http://doktorz.mooltied.de/stuff/scan-build-2009-03-13-2/

I've looked briefly at the "Logic Errors" and they all seem to be false positives. I did not have enough time to look into all the remaining "Dead Stores" though.

-- Benjamin
Previous: Junio C Hamano
Message 3 of 3 in “Remove unused assignments”
  1. Remove unused assignmentsBenjamin Kramer, Mar 13, 2009
  2. Junio C HamanoMar 14, 2009
  3. Benjamin KramerMar 14, 2009

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.