bool hasLeadingZeros() const { return (bool) HasLeadingZeroes; }
};
-} // end printf namespace
-
class FormatStringHandler {
public:
FormatStringHandler() {}
bool ParseFormatString(FormatStringHandler &H,
const char *beg, const char *end);
-
+} // end printf namespace
} // end clang namespace
#endif
using clang::analyze_printf::FormatSpecifier;
using clang::analyze_printf::OptionalAmount;
using clang::analyze_printf::ArgTypeResult;
+using clang::analyze_printf::FormatStringHandler;
using namespace clang;
namespace {
}
static FormatSpecifierResult ParseFormatSpecifier(FormatStringHandler &H,
- const char *&Beg, const char *E) {
+ const char *&Beg,
+ const char *E) {
using namespace clang::analyze_printf;
return FormatSpecifierResult(Start, FS);
}
-bool clang::ParseFormatString(FormatStringHandler &H,
+bool clang::analyze_printf::ParseFormatString(FormatStringHandler &H,
const char *I, const char *E) {
// Keep looking for a format specifier until we have exhausted the string.
while (I != E) {
}
namespace {
-class CheckPrintfHandler : public FormatStringHandler {
+class CheckPrintfHandler : public analyze_printf::FormatStringHandler {
Sema &S;
const StringLiteral *FExpr;
const Expr *OrigFormatExpr;
void HandleIncompleteFormatSpecifier(const char *startSpecifier,
unsigned specifierLen);
- void HandleInvalidConversionSpecifier(const analyze_printf::FormatSpecifier &FS,
- const char *startSpecifier,
- unsigned specifierLen);
+ void
+ HandleInvalidConversionSpecifier(const analyze_printf::FormatSpecifier &FS,
+ const char *startSpecifier,
+ unsigned specifierLen);
void HandleNullChar(const char *nullCharacter);
S.Diag(getLocationOfByte(CS.getStart()),
diag::warn_printf_conversion_argument_type_mismatch)
- << *T << Ex->getType()
- << getFormatSpecifierRange(startSpecifier, specifierLen)
- << Ex->getSourceRange();
+ << *T << Ex->getType();
+// << getFormatSpecifierRange(startSpecifier, specifierLen)
+// << Ex->getSourceRange();
}
return true;
}
isa<ObjCStringLiteral>(OrigFormatExpr), Str,
HasVAListArg, TheCall, format_idx);
- if (!ParseFormatString(H, Str, Str + StrLen))
+ if (!analyze_printf::ParseFormatString(H, Str, Str + StrLen))
H.DoneProcessing();
}