The following code incorrectly gives two error messages:
[test.c:11]: (error) Array 'cmd_str[8]' accessed at index 127, which is out of bounds. [test.c:15]: (error) Array 'cmd_str[8]' accessed at index 9998, which is out of bounds.
However the output of the program is as expected (ie, "cmd1" through "cmd7").
The following code incorrectly gives two error messages:
[test.c:11]: (error) Array 'cmd_str[8]' accessed at index 127, which is out of bounds.
[test.c:15]: (error) Array 'cmd_str[8]' accessed at index 9998, which is out of bounds.
However the output of the program is as expected (ie, "cmd1" through "cmd7").
Last edit: Paul Aitken 2015-11-16
Thanks for reporting it on http://trac.cppcheck.net/ticket/7139 as well..