Here is my .cfg
<?xml version="1.0"?>
<def format="1">
<function name="wcscpy_s">
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
</arg>
</function>
</def>
And I use it to check blow cpp file.
int main() {
char a[100];
wcscpy_s(
a,
a,
a);
}
And the error is:
D:\staff>cppcheck D:\staff\test.cpp --library=my.cfg
Checking D:\staff\test.cpp...
[D:\staff\test.cpp:4]: (error) Uninitialized variable: a
[D:\staff\test.cpp:5]: (error) Uninitialized variable: a
Obviously it not find the third parameter, it is unitialized too. I changed the file to this:
int main() {
char a[100];
wcscpy_s(
1,
1,
a);
}
And it not show any error now. So I'm very confused. Cppcheck can't check the third parameters?