Opened 12 years ago
Closed 11 years ago
#5128 closed Bugs (fixed)
Implicit constant overflow in non_blocking_io::name()
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.45.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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;
Note:
See TracTickets
for help on using tickets.
(In [69194]) Changes for asio version 1.5.0: