Fix FP for std::intmax_t passed as %jd into scanf
This commit is contained in:
parent
125daec71b
commit
eb4bb893b3
|
@ -846,7 +846,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, false);
|
||||
break;
|
||||
case 'j':
|
||||
if (argInfo.typeToken->originalName() != "intmax_t")
|
||||
if (!typesMatch(argInfo.typeToken->originalName(), "intmax_t"))
|
||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, false);
|
||||
break;
|
||||
case 'z':
|
||||
|
|
|
@ -1456,6 +1456,7 @@ private:
|
|||
TEST_SCANF_WARN_AKA("%jd", "intmax_t", "std::ptrdiff_t", "signed long", "signed long long");
|
||||
TEST_SCANF_NOWARN("%jd", "intmax_t", "intmax_t");
|
||||
TEST_SCANF_WARN_AKA("%jd", "intmax_t", "uintmax_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_NOWARN("%jd", "intmax_t", "std::intmax_t");
|
||||
|
||||
TEST_SCANF_WARN("%zu", "size_t", "bool");
|
||||
TEST_SCANF_WARN("%zu", "size_t", "char");
|
||||
|
|
Loading…
Reference in New Issue