summaryrefslogtreecommitdiffstats
path: root/clang-plugin/printf_check.cc
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-22 11:21:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-22 11:21:34 +0100
commit5c8a82ded139e2490daa83298d3e1f29c6e7b422 (patch)
tree39e32b400b7df260cdd8ceb0125827bb20283548 /clang-plugin/printf_check.cc
parentd524e67086f2802dd019adbfff3cc4ebd5eacf5d (diff)
downloadrspamd-5c8a82ded139e2490daa83298d3e1f29c6e7b422.tar.gz
rspamd-5c8a82ded139e2490daa83298d3e1f29c6e7b422.zip
[Minor] Fix clang plugin functions on OSX
Diffstat (limited to 'clang-plugin/printf_check.cc')
-rw-r--r--clang-plugin/printf_check.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/clang-plugin/printf_check.cc b/clang-plugin/printf_check.cc
index 35df5952d..37042d47a 100644
--- a/clang-plugin/printf_check.cc
+++ b/clang-plugin/printf_check.cc
@@ -590,11 +590,22 @@ namespace rspamd {
size_arg_handler (const Expr *arg, struct PrintfArgChecker *ctx)
{
if (sizeof (size_t) == sizeof (long)) {
- return check_builtin_type (arg,
- ctx,
- {BuiltinType::Kind::ULong,
- BuiltinType::Kind::Long},
- "%z");
+ if (sizeof (long long) == sizeof (long)) {
+ return check_builtin_type (arg,
+ ctx,
+ {BuiltinType::Kind::ULong,
+ BuiltinType::Kind::Long,
+ BuiltinType::Kind::LongLong,
+ BuiltinType::Kind::ULongLong},
+ "%z");
+ }
+ else {
+ return check_builtin_type (arg,
+ ctx,
+ {BuiltinType::Kind::ULong,
+ BuiltinType::Kind::Long},
+ "%z");
+ }
}
else if (sizeof (size_t) == sizeof (int)) {
return check_builtin_type (arg,