Without a minimal working example to reproduce the problem it is hard to help.
First of all, remove the check-config parameter since it does the following:
--check-config Check cppcheck configuration. The normal code
analysis is disabled by this flag.
If you define UNIT_TEST and this particular snippet is not active because of this, it won't show any problems.
Furthermore, you should specify "--enable=all" if you want to see errors because out-of-bounds is classified as error, not as style. Unused variable (as given in your example) is a style problem though.
Running cppcheck (v1.72)
cppcheck --enable=all --inconclusive --xml-version=2 -v foo.cpp
on this
void main()
{
char a[10];
a[10] = 0;
}
results in the following output for me
<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="1.72"/>
<errors>
<error id="unreadVariable" severity="style" msg="Variable 'a' is assigned a value that is never used." verbose="Variable 'a' is assigned a value that is never used.">
<location file="foo.cpp" line="5"/>
</error>
<error id="arrayIndexOutOfBounds" severity="error" msg="Array 'a[10]' accessed at index 10, which is out of bounds." verbose="Array 'a[10]' accessed at index 10, which is out of bounds.">
<location file="foo.cpp" line="5"/>
</error>
</errors>
</results>