with cfg files:
<?xml version="1.0"?><defformat="2"><definename="uint8"value="unsigned char"/><!-- Not part of standard, but widely supported by runtime libraries. --><!-- char * _itoa (int value, char * str, int base); --><functionname="objtest::_itoa"><noreturn>false</noreturn><leak-ignore/><returnValuetype="char *"/><argnr="1"direction="in"><not-uninit/></arg><argnr="2"direction="out"><not-null/></arg><argnr="3"direction="in"><not-uninit/><valid>2:36</valid></arg></function></def>
I wanna know how to write this cfg files???
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1.cpp:12:22: error: Invalid obj._itoa() argument nr 3. The value is 55 but the valid values are '2:36'. [invalidFunctionArg]
One current rule is that cppcheck does not use the configuration if the function declaration is seen. We need to have that rule for "external" functions like the standard functions. Is objtest::_itoa some "external" function in your case or something that you wrote yourself?
I believe we have some ticket in trac to add some mechanism in the cfg file so users can choose if configurations should be skipped when function declaration is seen or not. We want to skip the configuration in all the files we distribute I believe but users might often want to use their configurations.
Last edit: Daniel Marjamäki 2023-01-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
objtest::_itoa just like normal itoa function, and its code is in another cpp file.
I'll try your way to test our code. It's old and very big.
thanks a lot!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for your help!!!!!!!
i wanna check a class member function, how do I write .cfg files?
for example,
I wanna know how to write this cfg files???
If you comment out the class declaration it works:
I get this warning then:
1.cpp:12:22: error: Invalid obj._itoa() argument nr 3. The value is 55 but the valid values are '2:36'. [invalidFunctionArg]
One current rule is that cppcheck does not use the configuration if the function declaration is seen. We need to have that rule for "external" functions like the standard functions. Is
objtest::_itoa
some "external" function in your case or something that you wrote yourself?I believe we have some ticket in trac to add some mechanism in the cfg file so users can choose if configurations should be skipped when function declaration is seen or not. We want to skip the configuration in all the files we distribute I believe but users might often want to use their configurations.
Last edit: Daniel Marjamäki 2023-01-07
objtest::_itoa
just like normal itoa function, and its code is in another cpp file.I'll try your way to test our code. It's old and very big.
thanks a lot!