Fix FN for unsigned ptrdiff_t passed as %lu into scanf
This commit is contained in:
parent
054444167d
commit
b301b44897
|
@ -904,6 +904,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
||||||
} else if (argInfo.typeToken->str() != "long" || argInfo.typeToken->isLong())
|
} else if (argInfo.typeToken->str() != "long" || argInfo.typeToken->isLong())
|
||||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||||
else if (typesMatch(argInfo.typeToken->originalName(), "size_t") ||
|
else if (typesMatch(argInfo.typeToken->originalName(), "size_t") ||
|
||||||
|
typesMatch(argInfo.typeToken->originalName(), "ptrdiff_t") ||
|
||||||
argInfo.typeToken->originalName() == "uintmax_t")
|
argInfo.typeToken->originalName() == "uintmax_t")
|
||||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ private:
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","size_t","unsigned long","unsigned long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","size_t","unsigned long","unsigned long long");
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","ssize_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","ssize_t", "signed long", "signed long long");
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","ptrdiff_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","ptrdiff_t", "signed long", "signed long long");
|
||||||
TEST_SCANF_WARN_AKA_WIN64("%lu","unsigned long","unsigned ptrdiff_t", "unsigned long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","unsigned ptrdiff_t", "unsigned long", "unsigned long long");
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","intmax_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","intmax_t", "signed long", "signed long long");
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","uintmax_t","unsigned long", "unsigned long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","uintmax_t","unsigned long", "unsigned long long");
|
||||||
TEST_SCANF_WARN_AKA("%lu","unsigned long","intptr_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%lu","unsigned long","intptr_t", "signed long", "signed long long");
|
||||||
|
|
Loading…
Reference in New Issue