diff --git a/lib/check64bit.cpp b/lib/check64bit.cpp index 3eb6d65ef..320cea698 100644 --- a/lib/check64bit.cpp +++ b/lib/check64bit.cpp @@ -41,7 +41,7 @@ static bool isaddr(const Variable *var) /** Is given variable an integer variable */ static bool isint(const Variable *var) { - return (var && Token::Match(var->nameToken()->previous(), "int|long|DWORD")); + return (var && Token::Match(var->nameToken()->previous(), "int|long|DWORD %var% !![")); } void Check64BitPortability::pointerassignment() diff --git a/test/test64bit.cpp b/test/test64bit.cpp index 0699aaa5b..6974fb068 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -86,6 +86,13 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:3]: (portability) Assigning an address value to the integer (int/long/etc) type is not portable\n", errout.str()); + check("int foo(int p[])\n" + "{\n" + " int *a = p;\n" + " return a;\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); + check("void foo(int x)\n" "{\n" " int *p = x;\n"