[PATCH] improve clang's static analysis of __builtin_sprintf_chk()

Sam Parker sam.parker at arm.com
Tue Jun 30 08:58:34 PDT 2015


Thanks for all the feedback and tips, I have hopefully addressed the comments from the first patch by:

- reorganised the patch so that it only uses the printf specifier expression checker,
- I have also removed the CheckSprintfHandler class and moved the functionality into CheckPrintfHandler,
- used a switch statement on ConversionSpecifier::Kind to check each specifier,
- used Expr functionality to evaluate constant integer expressions,
- added platform specific checks for pointer formatting,
- I have created a specific error message which reports the size needed.

cheers,


http://reviews.llvm.org/D9665

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Sema.h
  lib/Sema/SemaChecking.cpp
  test/Sema/sprintf-chk.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9665.28789.patch
Type: text/x-patch
Size: 20782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150630/09c35546/attachment.bin>


More information about the cfe-commits mailing list