We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b9c887 commit cd494b2Copy full SHA for cd494b2
lib/checktype.cpp
@@ -383,9 +383,12 @@ void CheckType::checkLongCast()
383
const ValueType *type = tok->astOperand1()->valueType();
384
if (type && checkTypeCombination(*type, *retVt, *mSettings) &&
385
type->pointer == 0U &&
386
- type->originalTypeName.empty() &&
387
- !tok->astOperand1()->hasKnownIntValue())
388
- ret = tok;
+ type->originalTypeName.empty()) {
+ if (!tok->astOperand1()->hasKnownIntValue()) {
+ ret = tok;
389
+ } else if (!mSettings->platform.isIntValue(tok->astOperand1()->getKnownIntValue()))
390
391
+ }
392
}
393
// All return statements must have problem otherwise no warning
394
if (ret != tok) {
0 commit comments