[Boost-bugs] [Boost C++ Libraries] #5668: epoll_reactor implicit type conversion warnings:

Subject: [Boost-bugs] [Boost C++ Libraries] #5668: epoll_reactor implicit type conversion warnings:
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-04 16:24:43


#5668: epoll_reactor implicit type conversion warnings:
----------------------------------------------+-----------------------------
 Reporter: David Benoit <benoit@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
----------------------------------------------+-----------------------------
 I'm using boost 1.46.1 with gcc 4.1.2-44-rhel5 and -Wconversion and I get
 the following warnings (which are a problem as soon as I turn on -Werror):

 boost/asio/detail/impl/epoll_reactor.ipp: In constructor
 'boost::asio::detail::epoll_reactor::epoll_reactor(boost::asio::io_service&)':
 boost/asio/detail/impl/epoll_reactor.ipp:53: warning: negative integer
 implicitly converted to unsigned type
 boost/asio/detail/impl/epoll_reactor.ipp: In member function 'int
 boost::asio::detail::epoll_reactor::register_descriptor(boost::asio::detail::socket_type,
 boost::asio::detail::epoll_reactor::descriptor_state*&)':
 boost/asio/detail/impl/epoll_reactor.ipp:109: warning: negative integer
 implicitly converted to unsigned type
 boost/asio/detail/impl/epoll_reactor.ipp: In member function 'void
 boost::asio::detail::epoll_reactor::start_op(int,
 boost::asio::detail::socket_type,
 boost::asio::detail::epoll_reactor::descriptor_state*&,
 boost::asio::detail::reactor_op*, bool)':
 boost/asio/detail/impl/epoll_reactor.ipp:154: warning: negative integer
 implicitly converted to unsigned type
 boost/asio/detail/impl/epoll_reactor.ipp: In member function 'void
 boost::asio::detail::epoll_reactor::interrupt()':
 boost/asio/detail/impl/epoll_reactor.ipp:319: warning: negative integer
 implicitly converted to unsigned type

 In all of these cases, the line in question is of the form:

  ev.events = EPOLLIN | EPOLLERR | EPOLLET;

 Specifically, that EPOLLET (1 << 31), which is unsigned as an int, is
 included. (For example, line 61 doesn't have the same warning).

 Could the values here (EPOLLET at a minimum) please be wrapped as uint32_t
 (the type of ev.events)? (i.e. replacing all instances of EPOLLET with
 uint32_t(EPOLLET) removes the warning).

 Thanks!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5668>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC