CheckIO: Fix FN when using '%x' as format specifier for a 'signed int' variable
This commit is contained in:
parent
161412dc31
commit
966d078dcc
|
@ -770,7 +770,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
||||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (argInfo.typeToken->str() != "int")
|
if (argInfo.typeToken->str() != "int" || !argInfo.typeToken->isUnsigned())
|
||||||
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") ||
|
typesMatch(argInfo.typeToken->originalName(), "ptrdiff_t") ||
|
||||||
|
|
|
@ -1186,8 +1186,8 @@ private:
|
||||||
TEST_SCANF("%x", "unsigned int", "short");
|
TEST_SCANF("%x", "unsigned int", "short");
|
||||||
TEST_SCANF("%x", "unsigned int", "signed short");
|
TEST_SCANF("%x", "unsigned int", "signed short");
|
||||||
TEST_SCANF("%x", "unsigned int", "unsigned short");
|
TEST_SCANF("%x", "unsigned int", "unsigned short");
|
||||||
// TEST_SCANF("%x", "unsigned int", "int");
|
TEST_SCANF("%x", "unsigned int", "int");
|
||||||
// TODO TEST_SCANF("%x", "unsigned int", "signed int");
|
TEST_SCANF("%x", "unsigned int", "signed int");
|
||||||
TEST_SCANF("%x", "unsigned int", "long");
|
TEST_SCANF("%x", "unsigned int", "long");
|
||||||
TEST_SCANF("%x", "unsigned int", "signed long");
|
TEST_SCANF("%x", "unsigned int", "signed long");
|
||||||
TEST_SCANF("%x", "unsigned int", "unsigned long");
|
TEST_SCANF("%x", "unsigned int", "unsigned long");
|
||||||
|
|
Loading…
Reference in New Issue