[LLVMbugs] [Bug 11576] New: Use in block doesn't count as use to prevent dead store warning
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Dec 14 13:49:29 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=11576
Bug #: 11576
Summary: Use in block doesn't count as use to prevent dead
store warning
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: kremenek at apple.com
ReportedBy: tjw at me.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 7734
--> http://llvm.org/bugs/attachment.cgi?id=7734
test case
Allocating an object and then letting it be captured and used by a block
doesn't count as a use for dead store calculations, resulting in a spurious
warning.
clang version 3.1 (trunk 146587)
/Users/bungi/Source/LLVM/llvm/Release+Asserts/bin/clang --analyze
block-capture-vs-dead-store.m
block-capture-vs-dead-store.m:10:12: warning: Value stored to 'object' during
its initialization is never read
NSObject *object = [[[NSObject alloc] init] autorelease];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list