diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-05-01 14:48:54 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-05-01 14:48:54 +0000 |
commit | 969d63ea8c5820d1325ad27205fc34c4f5030a54 (patch) | |
tree | 7be73f01db63180925c7ab2f17d6174318b79aa2 /llvm/lib/Transforms/Utils/LowerSwitch.cpp | |
parent | d4fb951ce35315e1a3f5d760195fe23974c5e31f (diff) | |
download | bcm5719-llvm-969d63ea8c5820d1325ad27205fc34c4f5030a54.tar.gz bcm5719-llvm-969d63ea8c5820d1325ad27205fc34c4f5030a54.zip |
[clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs
Summary:
The `google-runtime-int` check currently fires on calls like:
printf("%lu", (unsigned long)foo);
However, the style guide says:
> Where possible, avoid passing arguments of types specified by
> bitwidth typedefs to printf-based APIs.
http://google.github.io/styleguide/cppguide.html#64-bit_Portability
This diff relaxes the check to not fire on parameters to functions
with the `__format__` attribute. (I didn't specifically check
for `__printf__` since there are a few variations.)
Test Plan: New tests added. Ran tests with:
% make -j16 check-clang-tools
Reviewers: alexfh, bkramer
Reviewed By: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D46293
llvm-svn: 331268
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerSwitch.cpp')
0 files changed, 0 insertions, 0 deletions