$ /opt/cppcheck-2.10/cppcheck --std=c99 --enable=all t6.c
Checking t6.c ...
t6.c:15:8: error: Array 'd[4]' accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds]
d[--i] = alpha[m & 0x3F]; // cppcheck False +
^
t6.c:12:14: note: Assuming that condition 'i<3' is not redundant
for (; i < 3; i++)
^ *t6.c:14:10: note: i is incremented', new value is 4
for (i++; i > 0; m >>= 6)
^
t6.c:14:10: note: i is incremented', new value is 5
for (i++; i > 0; m >>= 6)
^
t6.c:15:8: note: Array index out of bounds
d[--i] = alpha[m & 0x3F]; // cppcheck False +
^
$
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, did you already saw this one ?
$ /opt/cppcheck-2.10/cppcheck --std=c99 --enable=all t6.c
Checking t6.c ...
t6.c:15:8: error: Array 'd[4]' accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds]
d[--i] = alpha[m & 0x3F]; // cppcheck False +
^
t6.c:12:14: note: Assuming that condition 'i<3' is not redundant
for (; i < 3; i++)
^
*t6.c:14:10: note: i is incremented', new value is 4
for (i++; i > 0; m >>= 6)
^
t6.c:14:10: note: i is incremented', new value is 5
for (i++; i > 0; m >>= 6)
^
t6.c:15:8: note: Array index out of bounds
d[--i] = alpha[m & 0x3F]; // cppcheck False +
^
$
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11784