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

Andy Gibbs via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 07:25:36 PST 2016

AndyG updated this revision to Diff 49058.
AndyG marked 5 inline comments as done.
AndyG added a comment.

Updated patch according to the comments made.  Also spotted a corner-case where a double-diagnostic was produced, for example in the following where one string has too few arguments and the other string too many:

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

Hitherto, this produced two diagnostics: the first (correct) diagnostic that more '%' conversions exist than data arguments, but then a second diagnostic regarding uncovered arguments.  The second diagnostic is now suppressed since the format string that has too many does also cover all arguments.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15636.49058.patch
Type: text/x-patch
Size: 18181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160225/19064fcd/attachment-0001.bin>

More information about the cfe-commits mailing list