diff --git a/lib/check64bit.cpp b/lib/check64bit.cpp index 09beac543..0f4f41d25 100644 --- a/lib/check64bit.cpp +++ b/lib/check64bit.cpp @@ -74,7 +74,11 @@ void Check64BitPortability::pointerassignment() type = INT; else if (type == PTR && Token::Match(tok2, "- %var%") && isaddr(tok2->next()->variable())) type = PTRDIFF; - else if (Token::Match(tok2, "%type% (")) { + else if (Token::Match(tok2, "(")) { + type = NO; + break; + } else if (tok2->str() == "(") { + // TODO: handle parentheses type = NO; break; } else if (type == PTR && Token::simpleMatch(tok2, ".")) diff --git a/test/test64bit.cpp b/test/test64bit.cpp index 6993b1b86..13e0884d8 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -193,6 +193,12 @@ private: " return 1 + p->i;\n" "}"); ASSERT_EQUALS("", errout.str()); + + check("static void __iomem *f(unsigned int port_no) {\n" + " void __iomem *mmio = hpriv->mmio;\n" + " return mmio + (port_no * 0x80);\n" + "}"); + ASSERT_EQUALS("", errout.str()); } };