This revision was automatically updated to reflect the committed changes.
Closed by commit rL285253: [analyzer] Report CFNumberGetValue API misuse
(authored by zaks).
Changed prior to commit:
https://reviews.llvm.org/D25876?vs=75488&id=75961#toc
Repository:
rL LLVM
https://reviews.llvm.org/
zaks.anna added inline comments.
Comment at: test/Analysis/CFNumber.c:39
+ unsigned char scalar = 0;
+ CFNumberGetValue(x, kCFNumberSInt16Type, &scalar); // expected-warning{{A
CFNumber object that represents a 16-bit integer is used to initialize an 8-bit
integer; 8 bits of
NoQ added inline comments.
Comment at: test/Analysis/CFNumber.c:39
+ unsigned char scalar = 0;
+ CFNumberGetValue(x, kCFNumberSInt16Type, &scalar); // expected-warning{{A
CFNumber object that represents a 16-bit integer is used to initialize an 8-bit
integer; 8 bits of the C
zaks.anna updated this revision to Diff 75488.
zaks.anna added a comment.
Address comments from Devin.
https://reviews.llvm.org/D25876
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
test/Analysis/CFNumber.c
Index: test/A
dcoughlin added a comment.
LGTM!
https://reviews.llvm.org/D25876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
dcoughlin added inline comments.
Comment at: test/Analysis/CFNumber.c:39
+ unsigned char scalar = 0;
+ CFNumberGetValue(x, kCFNumberSInt16Type, &scalar); // expected-warning{{A
CFNumber object that represents a 16 bit integer is used to initialize an 8 bit
integer. 8 bits of
zaks.anna created this revision.
zaks.anna added reviewers: dcoughlin, NoQ.
zaks.anna added subscribers: cfe-commits, rgov.
This patch contains 2 improvements to the CFNumber checker:
- Checking of CFNumberGetValue misuse.
- Treating all CFNumber API misuse errors as non-fatal. (Previously we tre