static bool int32_arg_handler (const Expr *arg,
struct PrintfArgChecker *ctx);
+ static bool gboolean_arg_handler (const Expr *arg,
+ struct PrintfArgChecker *ctx);
+
static bool tok_arg_handler (const Expr *arg,
struct PrintfArgChecker *ctx);
case 'D':
return llvm::make_unique<PrintfArgChecker> (int32_arg_handler,
this->pcontext, this->ci);
+ case 'b':
+ return llvm::make_unique<PrintfArgChecker> (gboolean_arg_handler,
+ this->pcontext, this->ci);
case 'T':
return llvm::make_unique<PrintfArgChecker> (tok_arg_handler,
this->pcontext, this->ci);
format_specs = {
's', 'd', 'l', 'L', 'v', 'V', 'f', 'F', 'g', 'G',
- 'T', 'z', 'D', 'c', 'p', 'P', 'e'
+ 'T', 'z', 'D', 'c', 'p', 'P', 'e', 'b'
};
};
return true;
}
+ static bool
+ gboolean_arg_handler (const Expr *arg, struct PrintfArgChecker *ctx)
+ {
+ return check_builtin_type (arg,
+ ctx,
+ {BuiltinType::Kind::Int}, // gboolean is int in fact
+ "%b");
+ }
+
static bool
check_struct_type (const Expr *arg, struct PrintfArgChecker *ctx,
const std::string &sname, const std::string &fmt)