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