]> granicus.if.org Git - clang/commit
Reduce false positives in printf/scanf format checker
authorAndy Gibbs <andyg1001@hotmail.co.uk>
Fri, 26 Feb 2016 15:35:16 +0000 (15:35 +0000)
committerAndy Gibbs <andyg1001@hotmail.co.uk>
Fri, 26 Feb 2016 15:35:16 +0000 (15:35 +0000)
commitf883b21a96192ffd3c1284fa74a8b7d7c4c8dd8c
treefd795bfda8c3b4a0534461e72f9103a6ba41a454
parent311881f68842c0aab714cffe6618f3ec7be1ca30
Reduce false positives in printf/scanf format checker

Summary:
The printf/scanf format checker is a little over-zealous in handling the conditional operator.  This patch reduces work by not checking code-paths that are never used and reduces false positives regarding uncovered arguments, for example in the code fragment:

printf(minimal ? "%i\n" : "%i: %s\n", code, msg);

Reviewers: rtrieu

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15636

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262025 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/Sema/format-strings-scanf.c
test/Sema/format-strings.c