зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
243b64b000
Коммит
bef679c131
|
@ -282,11 +282,16 @@ Sema::CheckPrintfArguments(Expr *Fn,
|
||||||
|
|
||||||
// Seen '%'. Now processing a format conversion.
|
// Seen '%'. Now processing a format conversion.
|
||||||
switch (Str[StrIdx]) {
|
switch (Str[StrIdx]) {
|
||||||
|
// Handle dynamic precision specifier.
|
||||||
|
case '*':
|
||||||
|
if (Str[StrIdx-1] == '.') ++numConversions;
|
||||||
|
break;
|
||||||
|
|
||||||
// Characters which can terminate a format conversion
|
// Characters which can terminate a format conversion
|
||||||
// (e.g. "%d"). Characters that specify length modifiers or
|
// (e.g. "%d"). Characters that specify length modifiers or
|
||||||
// other flags are handled by the default case below.
|
// 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 'i':
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'o':
|
case 'o':
|
||||||
|
|
Загрузка…
Ссылка в новой задаче