Hi ,
I am using cppcheck 1.68.
i am facing a problem. i am using cppcheck for about 20k files.
i found some error while analysing , its about "arrayIndexOutOfBounds".
Even though i include a header corresponding to this error , still it reports the same error.
To analyse it a bit further , i wrote a sample program and complied and executed it. this program executed well.
<?xml version="1.0" encoding="UTF-8"?><resultsversion="2"><cppcheckversion="1.68"/><errors><errorid="unreadVariable"severity="style"msg="Variable 's1' is assigned a value that is never used."verbose="Variable 's1' is assigned a value that is never used."><locationfile="/bl4module4/bl4mod4/Dinesh/tmo/sample.c"line="5"/></error><errorid="arrayIndexOutOfBounds"severity="error"msg="Array 'e1[1]' accessed at index 1, which is out of bounds."verbose="Array 'e1[1]' accessed at index 1, which is out of bounds."><locationfile="/bl4module4/bl4mod4/Dinesh/tmo/sample.c"line="7"/></error><errorid="arrayIndexOutOfBounds"severity="error"msg="Array 'e1[1]' accessed at index 1, which is out of bounds."verbose="Array 'e1[1]' accessed at index 1, which is out of bounds."><locationfile="/bl4module4/bl4mod4/Dinesh/tmo/sample.c"line="8"/>**
</error></errors></results>
PLease note the error arrayIndexOutOfBounds, i have declared the name which is of size of 10 in sample.h header, but even though after including the header details in the cppcheck execution , this error is being reported .
is that i am doing anything wrong above?
please clarify.
Regards,
Dinesh
Last edit: Daniel Marjamäki 2016-06-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi ,
I am using cppcheck 1.68.
i am facing a problem. i am using cppcheck for about 20k files.
i found some error while analysing , its about "arrayIndexOutOfBounds".
Even though i include a header corresponding to this error , still it reports the same error.
To analyse it a bit further , i wrote a sample program and complied and executed it. this program executed well.
sample.c
sample.h
and i issue the cppcheck command as below:
and the report is as cppcheck_rep.xml:
PLease note the error arrayIndexOutOfBounds, i have declared the name which is of size of 10 in sample.h header, but even though after including the header details in the cppcheck execution , this error is being reported .
is that i am doing anything wrong above?
please clarify.
Regards,
Dinesh
Last edit: Daniel Marjamäki 2016-06-20
Thanks!
it is a bug in cppcheck.
Can you please report this in our bug tracker so we don't forget it?
http://trac.cppcheck.net