Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef SOCKET socket_type;
- class socket_holder
- {
- ....
- socket_type socket_;
- ....
- socket_type get() const { return socket_; }
- ....
- };
- template <typename Socket>
- boost::system::error_code accept(....)
- {
- ....
- // On success, assign new connection to peer socket object.
- if (new_socketnew_socket.get() >= 0)
- {
- if (peer_endpoint)
- peer_endpoint->resize(addr_len);
- if (!peer.assign(impl.protocol_, new_socket.get(), ec))
- new_socket.release();
- }
- return ec;
- }
- This suspicious code was found in Boost project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression 'new_socket.get() >= 0' is always true. Unsigned type value is always >= 0. win_iocp_socket_service.hpp 436
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement