this gives the error arrayIndexOutOfBounds Array 'a[2]' accessed at index 2, which is out of bounds, because it looks like the code that computes the size of std::array doesn't handle the constexpr value correctly. However, changing that line to "#define blockLen 10" also gave the same error. This reproduces with 1.88 and top-of-tree from git.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Trac server has moved and https does not work yet. It should work like before sooner or later.
Meanwhile you can view the ticket here: http://trac.cppcheck.net/ticket/9202
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I saw this last night checking some of our internal code and shrunk down to this test case:
this gives the error arrayIndexOutOfBounds Array 'a[2]' accessed at index 2, which is out of bounds, because it looks like the code that computes the size of std::array doesn't handle the constexpr value correctly. However, changing that line to "#define blockLen 10" also gave the same error. This reproduces with 1.88 and top-of-tree from git.
This is related to this issue reported here:
https://trac.cppcheck.net/ticket/9202
That link seems to be dead. Ticket 9202 doesn't exist, it seems. Any other thoughts?
The Trac server has moved and https does not work yet. It should work like before sooner or later.
Meanwhile you can view the ticket here: http://trac.cppcheck.net/ticket/9202
https://trac.cppcheck.net/ticket/9202 was closed but did not fix this particular issue.
With
1.89 and master work fine.
But with
or
they do not. The arrayIndexOutOfBounds false positive pops up again.
Thanks!
@amai created a follow up ticket: https://trac.cppcheck.net/ticket/9386