Is there a way to disambiguous there two variable declaration (RAII) (local variable never used) Follow
This is an MFC example, but we have similar C++ RAII constructs (like lock guards) that generate the same warnings.
Is there a way to catch the unused variable s without catching the wait constructs like the CWaitCursor ?
Both generate a warning "Local variable .. is never used, but may have side effects in its destructor"
// do something without wait or s
Please sign in to leave a comment.
You can mark the guard classes with the [[rscpp::guard]] C++ attribute to silence the inspection. If the compiler complains about an unknown attribute, you can use the __RESHARPER__ macro like this:
Awesome, I also found the similar question with a good solution