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

silent "variable not used" warning #282

Merged
merged 1 commit into from
Dec 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions contrib/libzookeeper/src/mt_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ void *do_io(void *v)
// if it is_unrecoverable()
if(is_unrecoverable(zh))
break;

rc += 0; // silent "variable not used" warning
Copy link
Member

Choose a reason for hiding this comment

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

Now it is "dead store" and "expression without effect". More smart compiler and static analyzer could complain.
To fix it, just remove variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this variable used inside #if
to fix need to rewrite usage of 'rc' in this function

}
api_epilog(zh, 0);
LOG_DEBUG(("IO thread terminated"));
Expand Down