From 92303592c32434e6f8d8f321d1e78fcfec7ac7a4 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Sat, 8 Sep 2012 04:00:03 +0000 Subject: Format strings: %Ld isn't available on Darwin or Windows. This seems to be a GNU libc extension; we offer a fixit to %lld on these platforms. llvm-svn: 163452 --- clang/lib/Analysis/PrintfFormatString.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/Analysis/PrintfFormatString.cpp') diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp index 9e4c0fec4c0..9a4f0ca6bba 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/lib/Analysis/PrintfFormatString.cpp @@ -482,9 +482,11 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, namedTypeToLengthModifier(QT, LM); // If fixing the length modifier was enough, we are done. - const analyze_printf::ArgType &ATR = getArgType(Ctx, IsObjCLiteral); - if (hasValidLengthModifier() && ATR.isValid() && ATR.matchesType(Ctx, QT)) - return true; + if (hasValidLengthModifier(Ctx.getTargetInfo())) { + const analyze_printf::ArgType &ATR = getArgType(Ctx, IsObjCLiteral); + if (ATR.isValid() && ATR.matchesType(Ctx, QT)) + return true; + } // Set conversion specifier and disable any flags which do not apply to it. // Let typedefs to char fall through to int, as %c is silly for uint8_t. -- cgit v1.2.3