Fix FN for unsigned ptrdiff_t passed as %Ix into scanf
This commit is contained in:
parent
970aee9ce1
commit
89b83b2d16
|
@ -763,8 +763,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
||||||
} else if (specifier.find("I32") != std::string::npos) {
|
} else if (specifier.find("I32") != std::string::npos) {
|
||||||
if (argInfo.typeToken->str() != "int" || argInfo.typeToken->isLong())
|
if (argInfo.typeToken->str() != "int" || argInfo.typeToken->isLong())
|
||||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||||
} else if (!typesMatch(argInfo.typeToken->originalName(), "ptrdiff_t") &&
|
} else if (!typesMatch(argInfo.typeToken->originalName(), "size_t"))
|
||||||
!typesMatch(argInfo.typeToken->originalName(), "size_t"))
|
|
||||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
|
|
|
@ -1576,7 +1576,7 @@ private:
|
||||||
TEST_SCANF_NOWARN("%Ix", "size_t", "size_t");
|
TEST_SCANF_NOWARN("%Ix", "size_t", "size_t");
|
||||||
TEST_SCANF_WARN_AKA("%Ix", "size_t", "ssize_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%Ix", "size_t", "ssize_t", "signed long", "signed long long");
|
||||||
TEST_SCANF_WARN_AKA("%Ix", "size_t", "ptrdiff_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%Ix", "size_t", "ptrdiff_t", "signed long", "signed long long");
|
||||||
// TODO TEST_SCANF_WARN_AKA("%Ix", "size_t", "unsigned ptrdiff_t", "unsigned long", "unsigned long long");
|
TEST_SCANF_WARN_AKA("%Ix", "size_t", "unsigned ptrdiff_t", "unsigned long", "unsigned long long");
|
||||||
TEST_SCANF_WARN_AKA("%Ix", "size_t", "intmax_t", "signed long", "signed long long");
|
TEST_SCANF_WARN_AKA("%Ix", "size_t", "intmax_t", "signed long", "signed long long");
|
||||||
TEST_SCANF_WARN_AKA("%Ix", "size_t", "uintmax_t", "unsigned long", "unsigned long long");
|
TEST_SCANF_WARN_AKA("%Ix", "size_t", "uintmax_t", "unsigned long", "unsigned long long");
|
||||||
TEST_SCANF_NOWARN("%Ix", "size_t", "std::size_t");
|
TEST_SCANF_NOWARN("%Ix", "size_t", "std::size_t");
|
||||||
|
|
Loading…
Reference in New Issue