Skip to content
New issue

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

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

Already on GitHub? # to your account

Unused parameters #376

Closed
dnovikoff opened this issue Oct 6, 2014 · 2 comments
Closed

Unused parameters #376

dnovikoff opened this issue Oct 6, 2014 · 2 comments
Assignees
Milestone

Comments

@dnovikoff
Copy link
Contributor

Hello! I've tried to include your source code into my project, but found some uncomfartable warnings. I'am using gcc and compiling with -Werror -Wall -Wexrta.
This flags gives me at least 38 unused params warnings, when trying to compile examples/echo_server/echo_server.cpp

This is not real problem - I can mark this headers as 'system'. Most of the warnings are "nothing to worry about", still there are several suspicious one.

websocketpp/websocketpp/frame.hpp:466:24: error: unused parameter ‘eh’ [-Werror=unused-parameter]
I could not find any usages of set_size function. Still it looks like the 'eh' args should be deleted or there is some error.

websocketpp/impl/connection_impl.hpp:1694:6: error: unused parameter ‘msg’ [-Werror=unused-parameter]
websocketpp/impl/connection_impl.hpp:1724:6: error: unused parameter ‘msg’ [-Werror=unused-parameter]
websocketpp/impl/connection_impl.hpp:1708:6: error: unused parameter ‘msg’ [-Werror=unused-parameter]

I'am not sure, still it looks like it would be better to delete this or use.

  1. I'am giving you the rest of warnings. I think that it would be better to left only types (remove names) for those arguments or comment argument names.

websocketpp/transport/asio/security/none.hpp:162:21: error: unused parameter ‘strand’ [-Werror=unused-parameter]
websocketpp/transport/asio/security/none.hpp:162:21: error: unused parameter ‘is_server’ [-Werror=unused-parameter]
websocketpp/transport/asio/security/none.hpp:250:21: error: unused parameter ‘ec’ [-Werror=unused-parameter]
websocketpp/transport/asio/connection.hpp:1002:10: error: unused parameter ‘shutdown_timer’ [-Werror=unused-parameter]
websocketpp/transport/asio/connection.hpp:330:10: error: unused parameter ‘t’ [-Werror=unused-parameter]
websocketpp/transport/asio/connection.hpp:904:10: error: unused parameter ‘bytes_transferred’ [-Werror=unused-parameter]
websocketpp/transport/asio/connection.hpp:505:10: error: unused parameter ‘post_timer’ [-Werror=unused-parameter]
websocketpp/processors/processor.hpp:216:26: error: unused parameter ‘request’ [-Werror=unused-parameter]
websocketpp/transport/asio/connection.hpp:696:10: error: unused parameter ‘bytes_transferred’ [-Werror=unused-parameter]
websocketpp/processors/hybi07.hpp:52:21: error: unused parameter ‘req’ [-Werror=unused-parameter]
websocketpp/processors/hybi07.hpp:52:21: error: unused parameter ‘uri’ [-Werror=unused-parameter]
websocketpp/processors/hybi07.hpp:52:21: error: unused parameter ‘subprotocols’ [-Werror=unused-parameter]
websocketpp/processors/hybi08.hpp:53:21: error: unused parameter ‘req’ [-Werror=unused-parameter]
websocketpp/processors/hybi08.hpp:53:21: error: unused parameter ‘uri’ [-Werror=unused-parameter]
websocketpp/processors/hybi08.hpp:53:21: error: unused parameter ‘subprotocols’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:145:21: error: unused parameter ‘req’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:145:21: error: unused parameter ‘uri’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:145:21: error: unused parameter ‘subprotocols’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:151:21: error: unused parameter ‘req’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:151:21: error: unused parameter ‘res’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:168:21: error: unused parameter ‘req’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:168:21: error: unused parameter ‘subprotocol_list’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:322:21: error: unused parameter ‘in’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:322:21: error: unused parameter ‘out’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:327:21: error: unused parameter ‘in’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:327:21: error: unused parameter ‘out’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:332:21: error: unused parameter ‘code’ [-Werror=unused-parameter]
websocketpp/processors/hybi00.hpp:332:21: error: unused parameter ‘reason’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:56:18: error: unused parameter ‘attributes’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:72:21: error: unused parameter ‘in’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:72:21: error: unused parameter ‘out’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:76:21: error: unused parameter ‘buf’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:76:21: error: unused parameter ‘len’ [-Werror=unused-parameter]
websocketpp/extensions/permessage_deflate/disabled.hpp:76:21: error: unused parameter ‘out’ [-Werror=unused-parameter]

Hope that helps

P.S.

  1. I also payed attention to the fact there are 1,391 tabs in your source code (As I see the code style at this project is spaces)
  2. There is one more warning, that could be fixed
    websocketpp/websocketpp/sha1/sha1.hpp:46:41: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
  3. Thanks for the lib. It looks quite easy to handle with.
@zaphoyd
Copy link
Owner

zaphoyd commented Oct 7, 2014

A number of fixes for these issues have been committed to the development branch. If you could confirm that that branch fixes the warnings you are seeing that would be great.

@dnovikoff
Copy link
Contributor Author

Thanks for the fast responce. I've checked my project with 'develop' branch and confirm, that there is no more warnings compiling my project with the given flags.

@zaphoyd zaphoyd closed this as completed Oct 8, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants