Fix FP for std::uintmax_t passed as %ju and %jx into scanf
This commit is contained in:
parent
8fe4852b98
commit
c4b6db7e23
|
@ -768,7 +768,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||
break;
|
||||
case 'j':
|
||||
if (argInfo.typeToken->originalName() != "uintmax_t")
|
||||
if (!typesMatch(argInfo.typeToken->originalName(), "uintmax_t"))
|
||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||
break;
|
||||
case 'z':
|
||||
|
|
|
@ -1413,6 +1413,7 @@ private:
|
|||
TEST_SCANF_WARN_AKA("%ju", "uintmax_t", "std::size_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_WARN_AKA("%ju", "uintmax_t", "std::ssize_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%ju", "uintmax_t", "std::ptrdiff_t", "signed long", "signed long long");
|
||||
TEST_SCANF_NOWARN("%ju", "uintmax_t", "std::uintmax_t");
|
||||
TEST_SCANF_WARN_AKA("%ju", "uintmax_t", "std::intptr_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%ju", "uintmax_t", "std::uintptr_t", "unsigned long", "unsigned long long");
|
||||
|
||||
|
@ -1441,6 +1442,7 @@ private:
|
|||
TEST_SCANF_WARN_AKA("%jx", "uintmax_t", "std::size_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_WARN_AKA("%jx", "uintmax_t", "std::ssize_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%jx", "uintmax_t", "std::ptrdiff_t", "signed long", "signed long long");
|
||||
TEST_SCANF_NOWARN("%jx", "uintmax_t", "std::uintmax_t");
|
||||
TEST_SCANF_WARN_AKA("%jx", "uintmax_t", "std::intptr_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%jx", "uintmax_t", "std::uintptr_t", "unsigned long", "unsigned long long");
|
||||
|
||||
|
|
Loading…
Reference in New Issue