cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Fix false negative with multi-dimensional array

Open KenPatrickLehrmann opened this issue 4 years ago • 2 comments

void f() {
  char  foo[2][2];
  char *bar[2];
  bar[0] = foo[0];
  bar[1] = foo[1];
  bar[0][0] = 'a';
}

would give a FP:

[test.cpp:2]: (style) Variable 'foo' can be declared with const\n"

KenPatrickLehrmann avatar Sep 30 '21 09:09 KenPatrickLehrmann

@danmar Any feedback on this PR?

pfultz2 avatar Oct 14 '21 16:10 pfultz2

There appears to be merge conflicts for this PR.

pfultz2 avatar Jan 02 '22 04:01 pfultz2