File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ namespace {
4040 Check64BitPortability instance;
4141}
4242
43+ static bool isFunctionPointer (const Token* tok)
44+ {
45+ if (!tok || !tok->variable ())
46+ return false ;
47+ return Token::Match (tok->variable ()->nameToken (), " %name% ) (" );
48+ }
49+
4350void Check64BitPortability::pointerassignment ()
4451{
4552 if (!mSettings ->severity .isEnabled (Severity::portability))
@@ -103,7 +110,8 @@ void Check64BitPortability::pointerassignment()
103110 !tok->astOperand2 ()->isNumber () &&
104111 rhstype->pointer == 0U &&
105112 rhstype->originalTypeName .empty () &&
106- rhstype->type == ValueType::Type::INT)
113+ rhstype->type == ValueType::Type::INT &&
114+ !isFunctionPointer (tok->astOperand1 ()))
107115 assignmentIntegerToAddressError (tok);
108116
109117 // Assign pointer to integer..
You can’t perform that action at this time.
0 commit comments