diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-01-24 21:29:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-01-24 21:29:54 +0000 |
commit | 9d24c2cbd9cf1b7c165ccb13221f2efb2f4b49b0 (patch) | |
tree | ae2f66b9892e30f437bce30dc9bc7266319efa8b /lib/Analysis/PrintfFormatString.cpp | |
parent | 32d4abf2d1396b4434917320872a970415c08e6e (diff) |
Teach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR 9466.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index bc2b356934..dbe73c8f83 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -259,7 +259,8 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { if (CS.isIntArg()) switch (LM.getKind()) { case LengthModifier::AsLongDouble: - return ArgTypeResult::Invalid(); + // GNU extension. + return Ctx.LongLongTy; case LengthModifier::None: return Ctx.IntTy; case LengthModifier::AsChar: return ArgTypeResult::AnyCharTy; case LengthModifier::AsShort: return Ctx.ShortTy; @@ -280,7 +281,8 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { if (CS.isUIntArg()) switch (LM.getKind()) { case LengthModifier::AsLongDouble: - return ArgTypeResult::Invalid(); + // GNU extension. + return Ctx.UnsignedLongLongTy; case LengthModifier::None: return Ctx.UnsignedIntTy; case LengthModifier::AsChar: return Ctx.UnsignedCharTy; case LengthModifier::AsShort: return Ctx.UnsignedShortTy; |