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
Other solution would be to actually use a value. Then you could remove the unused variable warning with a macro.
unused variable
#define _unused(x) ((void)(x))
Then in your example, you'd have:
val = foo(); _unused(val);