[PATCH] D15636: Reduce false positives in printf/scanf format checker

Andy Gibbs via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 18 03:36:03 PST 2015


AndyG created this revision.
AndyG added a reviewer: cfe-commits.

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);

http://reviews.llvm.org/D15636

Files:
  include/clang/Sema/Sema.h
  lib/Sema/SemaChecking.cpp
  test/Sema/format-strings.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15636.43213.patch
Type: text/x-patch
Size: 12442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151218/72d63527/attachment-0001.bin>


More information about the cfe-commits mailing list