[LLVMbugs] [Bug 9423] New: False positive with *++p = value
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Mar 7 20:03:39 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9423
Summary: False positive with *++p = value
Product: clang
Version: unspecified
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: kremenek at apple.com
ReportedBy: marka at isc.org
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=6290)
--> (http://llvm.org/bugs/attachment.cgi?id=6290)
False positive example
Using prefix increment causes false positive. If "*++p = value;" is replaced
with "p++; *p = value;"
no fault is reported. The two constructs should be identical.
This was with checker-255.
scan-build -V make junk
/Users/marka/Downloads/checker-255/libexec/ccc-analyzer -g -O2
-I/usr/include/libxml2 junk.c -o junk
ANALYZE: junk.c foo
junk.c:7:3: warning: Assigned value is garbage or undefined
int new = *p;
^ ~~
ANALYZE: junk.c main
1 warning generated.
scan-build: 1 bugs found.
scan-build: Run 'scan-view
/var/folders/dB/dBXhI1vFESG2tu8vPjUq7U+++TI/-Tmp-/scan-build-2011-03-08-19' to
examine bug reports.
scan-build: Analysis run complete.
scan-build: Viewing analysis results in
'/var/folders/dB/dBXhI1vFESG2tu8vPjUq7U+++TI/-Tmp-/scan-build-2011-03-08-19'
using scan-view.
--
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