Is there a way to disambiguous there two variable declaration (RAII) (local variable never used)
Hi,
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"
void F()
{
CWaitCursor wait;
CString s;
// do something without wait or s
}
Thanks
Max.
Please sign in to leave a comment.
Hello,
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