Lately, I started using lint for static code analysis. One of the warning I get sometimes is regarding this issue. Let\'s say for instance that I\'ve got the following funct
For a static code checker to be useful, it should report also the ignored return values, which can lead very often to difficult to track errors - or missing error handling.
So you should keep the (void) or deactivate the check for printf. Now you have several options for doing it in a readable manner. I use to wrap the function inside a new function like for example
void printf_unchecked(const char* format, ...)
where the not so nice cast takes place. Perhaps it's more practical to do it using a preprocessor macro in this case because of the varargs...