summaryrefslogtreecommitdiffstats
path: root/clang/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
commit6a6c08c319125b17526b5d3abf6ac469cf8fc2b2 (patch)
tree28663ba043bb80670530c1b062db3068872074ef /clang/Sema/SemaChecking.cpp
parentbe37007e64bda723c5991648b0df335a893aa91f (diff)
downloadbcm5719-llvm-6a6c08c319125b17526b5d3abf6ac469cf8fc2b2.tar.gz
bcm5719-llvm-6a6c08c319125b17526b5d3abf6ac469cf8fc2b2.zip
Printf argument checking now supports dynamically-passed precision
specifiers. llvm-svn: 42886
Diffstat (limited to 'clang/Sema/SemaChecking.cpp')
-rw-r--r--clang/Sema/SemaChecking.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/Sema/SemaChecking.cpp b/clang/Sema/SemaChecking.cpp
index 863882ec986..ea63b7dc1ca 100644
--- a/clang/Sema/SemaChecking.cpp
+++ b/clang/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':
OpenPOWER on IntegriCloud