Subject: Re: [PATCH] Remove unused assignments

From: Benjamin Kramer <[email-masked]>
Date: Sat, 14 Mar 2009 21:57:13 +0100

Junio C Hamano wrote:
> 
> 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