aboutsummaryrefslogtreecommitdiff
path: root/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-12 00:11:27 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-12 00:11:27 +0000
commitbef679c131920ee15a059c80969e6f3f7a0c0ae7 (patch)
tree19fc12f62607e1a8a4778fbba8e81d7a4b5c8f3a /Sema/SemaChecking.cpp
parent243b64b0001172405ff803c61bdcaa8e98ec1552 (diff)
Printf argument checking now supports dynamically-passed precision
specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Sema/SemaChecking.cpp')
-rw-r--r--Sema/SemaChecking.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp
index 863882ec98..ea63b7dc1c 100644
--- a/Sema/SemaChecking.cpp
+++ b/Sema/SemaChecking.cpp
@@ -282,11 +282,16 @@ Sema::CheckPrintfArguments(Expr *Fn,
// Seen '%'. Now processing a format conversion.
switch (Str[StrIdx]) {
+ // Handle dynamic precision specifier.
+ case '*':
+ if (Str[StrIdx-1] == '.') ++numConversions;
+ break;
+
// Characters which can terminate a format conversion
// (e.g. "%d"). Characters that specify length modifiers or
// other flags are handled by the default case below.
//
- // TODO: additional checks will go into the following cases.
+ // FIXME: additional checks will go into the following cases.
case 'i':
case 'd':
case 'o':