diff --git a/lib/checkio.cpp b/lib/checkio.cpp index df4c23d4d..86671798a 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -904,6 +904,7 @@ void CheckIO::checkFormatString(const Token * const tok, } else if (argInfo.typeToken->str() != "long" || argInfo.typeToken->isLong()) invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true); else if (typesMatch(argInfo.typeToken->originalName(), "size_t") || + typesMatch(argInfo.typeToken->originalName(), "ptrdiff_t") || argInfo.typeToken->originalName() == "uintmax_t") invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true); break; diff --git a/test/testio.cpp b/test/testio.cpp index 475e6d2d3..8eec46995 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -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","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_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","uintmax_t","unsigned long", "unsigned long long"); TEST_SCANF_WARN_AKA("%lu","unsigned long","intptr_t", "signed long", "signed long long");