I'm playing with the last static analyzer (I'm always working with the svn trunk ;-)) and I'm scanning some of my projects.
I confirm that it is a very valuable tool.
I give you a fase positive (I think it 's one). It says I never read values out of keys, but I'm using it twice in the condition.
void DeadStoreTest(NSObject *anObject) {
NSArray *keys;
// analyze result: Although the value stored to 'keys' is used in the enclosing expression, the value is never actually read from 'keys'
if ((keys = [anObject exposedBindings]) &&
([keys containsObject:@"name"] && [keys containsObject:@"icon"])) {
// do something without keys
}
}
testdead.m (248 Bytes)