Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appended the suppression of unused local variables using RAII #249

Merged
merged 2 commits into from
Oct 19, 2015

Conversation

Hinterwaeldlers
Copy link
Contributor

This changes allow to suppress the complains about unused variables.
When using RAII such as std::lock_guard the intention of do not access the variable further is intended

There are two variables, which allow to change the baviour:
RAII_DEFAULT_CLASSES which suppress std::lock_guard and std::unique_lock
RAII_CUSTOM_CLASSES to allow the user to define further own created parts

At the moment there are no tests appended and maybe further classes should be appended to the default definition

Martin Güthle added 2 commits October 6, 2015 00:54
…in RAII manner

This protect the false positives about some basic classes such as std::lock_guard

Some additional checks should be appended, to ensure that the given configuration is valid
if (!isUnusedLocalVariable(varDecl))
{
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentations for above two lines.

@ryuichis
Copy link
Contributor

Again, liked the code changes a lot. Thanks for the work. Let's add tests before merging them.

@ryuichis ryuichis merged commit 48c98c7 into oclint:master Oct 19, 2015
@ryuichis
Copy link
Contributor

Merged this with some test changes as well. Thank you, @Hinterwaeldlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants