I have added an inline comment to suppress a cppcheck unusedFunction warning for a function, but I would like to include this within the function header so that Doxygen can document all of the unused functions (I am implementing an API, so I have many functions that will not be used in my source). I would prefer not to suppress all unusedFunction errors, but rather on a per-function basis.
I would like to do something like this:
/**
* API function description
*
* @param p1 function pointer to the ...
* @return 0 if successful, -1 otherwise.
* // cppcheck-suppress unusedFunction
*/
int CreateTask(Task_FuncPtr p1)
{
return doSomething();
}
But when I do this, cppcheck does not "see" the inline suppression. If I move it outside the header, but just before the function declaration then the suppression works. The cppcheck documentation seems to imply that the suppression needs to be directly before the line generating then error.
Has any had success with this?