Subject: [Boost-bugs] [Boost C++ Libraries] #5128: Implicit constant overflow in non_blocking_io::name()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-27 08:31:14
#5128: Implicit constant overflow in non_blocking_io::name()
----------------------------------+-----------------------------------------
Reporter: hannesf@⦠| Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.45.0 | Severity: Problem
Keywords: |
----------------------------------+-----------------------------------------
non_blocking_io::name() returns FIONBIO as an int, without explicit cast.
On Mac OS X (10.6.6), the FIONBIO macro evaluates to
((__uint32_t)0x80000000 | ((sizeof(int) & 0x1fff) << 16) | ((('f')) << 8)
| ((126)))
While this is a perfectly valid 32-bit number (0x8004667e), the implicit
cast to int generates an
'Overflow in implicit constant conversion' warning, which makes the build
fail if '-Werror' is specified.
A simple solution would be to modify non_blocking_io::name() to
return (int)FIONBIO;
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5128> 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:05 UTC