File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ static bool isaddr(const Variable *var)
4141/* * Is given variable an integer variable */
4242static bool isint (const Variable *var)
4343{
44- return (var && Token::Match (var->nameToken ()->previous (), " int|long|DWORD" ));
44+ return (var && Token::Match (var->nameToken ()->previous (), " int|long|DWORD %var% !![ " ));
4545}
4646
4747void Check64BitPortability::pointerassignment ()
Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ class Test64BitPortability : public TestFixture
8686 " }\n " );
8787 ASSERT_EQUALS (" [test.cpp:3]: (portability) Assigning an address value to the integer (int/long/etc) type is not portable\n " , errout.str ());
8888
89+ check (" int foo(int p[])\n "
90+ " {\n "
91+ " int *a = p;\n "
92+ " return a;\n "
93+ " }\n " );
94+ ASSERT_EQUALS (" " , errout.str ());
95+
8996 check (" void foo(int x)\n "
9097 " {\n "
9198 " int *p = x;\n "
You can’t perform that action at this time.
0 commit comments