Boost C++ Libraries: Ticket #3905: asio boost headers fail with g++-4.3.2 and -Wshadow -Werror https://svn.boost.org/trac10/ticket/3905 <p> All of my asio dependent code builds fine as long as I suppress gcc's warnings. One of the warning flags that causes a problem is -Wshadow. I think using the io_service_pool from the asio documentation's examples is sufficient to reproduce this problem. Just be sure to add -Werror and -Wshadow with a recent g++ and the build should fail in asio headers. </p> <pre class="wiki">boost-1.42/include/boost/asio/detail/hash_map.hpp:150: error: declaration of 'end' shadows a member of 'this' boost-1.42/include/boost/asio/detail/service_base.hpp:37: error: declaration of 'io_service' shadows a member of 'this' boost-1.42/include/boost/asio/detail/reactor_op_queue.hpp:329: error: declaration of 'descriptor' shadows a member of 'this' boost-1.42/include/boost/asio/detail/epoll_reactor.hpp:655: error: declaration of 'interrupt' shadows a member of 'this' boost-1.42/include/boost/asio/basic_io_object.hpp:72: error: declaration of 'io_service' shadows a member of 'this' boost-1.42/include/boost/asio/detail/deadline_timer_service.hpp:151: error: declaration of 'boost::system::error_code ec' shadows a parameter boost-1.42/include/boost/asio/serial_port_service.hpp:88: error: declaration of 'io_service' shadows a member of 'this' boost-1.42/include/boost/asio/basic_streambuf.hpp:136: error: declaration of 'max_size' shadows a member of 'this' boost-1.42/include/boost/asio/detail/buffered_stream_storage.hpp:43: error: declaration of 'capacity' shadows a member of 'this' boost-1.42/include/boost/asio/ip/address_v6.hpp:68: error: declaration of 'scope_id' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_endpoint.hpp:95: error: declaration of 'protocol' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_endpoint.hpp:190: error: declaration of 'size' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_entry.hpp:55: error: declaration of 'service_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_entry.hpp:55: error: declaration of 'host_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_entry.hpp:55: error: declaration of 'endpoint' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:52: error: declaration of 'service_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:71: error: declaration of 'service_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:88: error: declaration of 'service_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:88: error: declaration of 'host_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:107: error: declaration of 'service_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/basic_resolver_query.hpp:107: error: declaration of 'host_name' shadows a member of 'this' boost-1.42/include/boost/asio/ip/icmp.hpp:105: error: declaration of 'family' shadows a member of 'this' boost-1.42/include/boost/asio/ip/icmp.hpp:105: error: declaration of 'protocol' shadows a member of 'this' boost-1.42/include/boost/asio/ip/tcp.hpp:149: error: declaration of 'family' shadows a member of 'this' boost-1.42/include/boost/asio/ip/udp.hpp:105: error: declaration of 'family' shadows a member of 'this' boost-1.42/include/boost/asio/local/basic_endpoint.hpp:83: error: declaration of 'path' shadows a member of 'this' boost-1.42/include/boost/asio/local/basic_endpoint.hpp:90: error: declaration of 'path' shadows a member of 'this' boost-1.42/include/boost/asio/local/basic_endpoint.hpp:136: error: declaration of 'size' shadows a member of 'this' boost-1.42/include/boost/asio/local/basic_endpoint.hpp:216: error: declaration of 'path' shadows a member of 'this' boost-1.42/include/boost/asio/posix/stream_descriptor_service.hpp:103: error: declaration of 'io_service' shadows a member of 'this' boost-1.42/include/boost/asio/impl/read_until.ipp:379: error: declaration of 'boost::system::error_code ec' shadows a parameter boost-1.42/include/boost/asio/impl/read_until.ipp:711: error: declaration of 'boost::system::error_code ec' shadows a parameter boost-1.42/include/boost/asio/impl/read_until.ipp:880: error: declaration of 'boost::system::error_code ec' shadows a parameter boost-1.42/include/boost/asio/detail/strand_service.hpp:289: error: declaration of 'io_service' shadows a member of 'this' </pre><p> and so on ... </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3905 Trac 1.4.3 Justin Randall <logicle@…> Sat, 06 Feb 2010 20:10:24 GMT <link>https://svn.boost.org/trac10/ticket/3905#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3905#comment:1</guid> <description> <p> After grabbing the trunk at 59528 from subversion, I've made local modifications to address the problem. They are all cosmetic, mostly changing names. The new names could probably be better. </p> <p> Output of svn diff from boost/asio: </p> <pre class="wiki">Index: basic_socket.hpp =================================================================== --- basic_socket.hpp (revision 59528) +++ basic_socket.hpp (working copy) @@ -63,8 +63,8 @@ * @param io_service The io_service object that the socket will use to * dispatch handlers for any asynchronous operations performed on the socket. */ - explicit basic_socket(boost::asio::io_service&amp; io_service) - : basic_io_object&lt;SocketService&gt;(io_service) + explicit basic_socket(boost::asio::io_service&amp; ioservice) + : basic_io_object&lt;SocketService&gt;(ioservice) { } @@ -103,9 +103,9 @@ * * @throws boost::system::system_error Thrown on failure. */ - basic_socket(boost::asio::io_service&amp; io_service, + basic_socket(boost::asio::io_service&amp; ioservice, const endpoint_type&amp; endpoint) - : basic_io_object&lt;SocketService&gt;(io_service) + : basic_io_object&lt;SocketService&gt;(ioservice) { boost::system::error_code ec; this-&gt;service.open(this-&gt;implementation, endpoint.protocol(), ec); Index: basic_io_object.hpp =================================================================== --- basic_io_object.hpp (revision 59528) +++ basic_io_object.hpp (working copy) @@ -68,8 +68,8 @@ * Performs: * @code service.construct(implementation); @endcode */ - explicit basic_io_object(boost::asio::io_service&amp; io_service) - : service(boost::asio::use_service&lt;IoObjectService&gt;(io_service)) + explicit basic_io_object(boost::asio::io_service&amp; io_srv) + : service(boost::asio::use_service&lt;IoObjectService&gt;(io_srv)) { service.construct(implementation); } Index: serial_port_service.hpp =================================================================== --- serial_port_service.hpp (revision 59528) +++ serial_port_service.hpp (working copy) @@ -84,9 +84,9 @@ #endif /// Construct a new serial port service for the specified io_service. - explicit serial_port_service(boost::asio::io_service&amp; io_service) - : boost::asio::detail::service_base&lt;serial_port_service&gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + explicit serial_port_service(boost::asio::io_service&amp; io_srv) + : boost::asio::detail::service_base&lt;serial_port_service&gt;(io_srv), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_srv)) { } Index: local/basic_endpoint.hpp =================================================================== --- local/basic_endpoint.hpp (revision 59528) +++ local/basic_endpoint.hpp (working copy) @@ -79,16 +79,16 @@ } /// Construct an endpoint using the specified path name. - basic_endpoint(const char* path) + basic_endpoint(const char* pathname) { using namespace std; // For strlen. - init(path, strlen(path)); + init(path, strlen(pathname)); } /// Construct an endpoint using the specified path name. - basic_endpoint(const std::string&amp; path) + basic_endpoint(const std::string&amp; pathname) { - init(path.data(), path.length()); + init(path.data(), pathname.length()); } /// Copy constructor. @@ -132,20 +132,20 @@ } /// Set the underlying size of the endpoint in the native type. - void resize(std::size_t size) + void resize(std::size_t s) { - if (size &gt; sizeof(boost::asio::detail::sockaddr_un_type)) + if (s &gt; sizeof(boost::asio::detail::sockaddr_un_type)) { boost::system::system_error e(boost::asio::error::invalid_argument); boost::throw_exception(e); } - else if (size == 0) + else if (s == 0) { path_length_ = 0; } else { - path_length_ = size + path_length_ = s - offsetof(boost::asio::detail::sockaddr_un_type, sun_path); // The path returned by the operating system may be NUL-terminated. @@ -212,7 +212,7 @@ std::size_t path_length_; // Initialise with a specified path. - void init(const char* path, std::size_t path_length) + void init(const char* pathname, std::size_t path_length) { if (path_length &gt; sizeof(data_.local.sun_path) - 1) { @@ -224,7 +224,7 @@ using namespace std; // For memcpy. data_.local = boost::asio::detail::sockaddr_un_type(); data_.local.sun_family = AF_UNIX; - memcpy(data_.local.sun_path, path, path_length); + memcpy(data_.local.sun_path, pathname, path_length); path_length_ = path_length; // NUL-terminate normal path names. Names that start with a NUL are in the Index: basic_stream_socket.hpp =================================================================== --- basic_stream_socket.hpp (revision 59528) +++ basic_stream_socket.hpp (working copy) @@ -66,8 +66,8 @@ * @param io_service The io_service object that the stream socket will use to * dispatch handlers for any asynchronous operations performed on the socket. */ - explicit basic_stream_socket(boost::asio::io_service&amp; io_service) - : basic_socket&lt;Protocol, StreamSocketService&gt;(io_service) + explicit basic_stream_socket(boost::asio::io_service&amp; ioservice) + : basic_socket&lt;Protocol, StreamSocketService&gt;(ioservice) { } Index: datagram_socket_service.hpp =================================================================== --- datagram_socket_service.hpp (revision 59528) +++ datagram_socket_service.hpp (working copy) @@ -100,10 +100,10 @@ #endif /// Construct a new datagram socket service for the specified io_service. - explicit datagram_socket_service(boost::asio::io_service&amp; io_service) + explicit datagram_socket_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - datagram_socket_service&lt;Protocol&gt; &gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + datagram_socket_service&lt;Protocol&gt; &gt;(ioservice), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(ioservice)) { } Index: basic_socket_acceptor.hpp =================================================================== --- basic_socket_acceptor.hpp (revision 59528) +++ basic_socket_acceptor.hpp (working copy) @@ -73,8 +73,8 @@ * dispatch handlers for any asynchronous operations performed on the * acceptor. */ - explicit basic_socket_acceptor(boost::asio::io_service&amp; io_service) - : basic_io_object&lt;SocketAcceptorService&gt;(io_service) + explicit basic_socket_acceptor(boost::asio::io_service&amp; ioservice) + : basic_io_object&lt;SocketAcceptorService&gt;(ioservice) { } Index: impl/read_until.ipp =================================================================== --- impl/read_until.ipp (revision 59528) +++ impl/read_until.ipp (working copy) @@ -376,8 +376,8 @@ if (streambuf_.size() == streambuf_.max_size()) { std::size_t bytes = 0; - boost::system::error_code ec(error::not_found); - handler_(ec, bytes); + boost::system::error_code errc(error::not_found); + handler_(errc, bytes); return; } @@ -708,8 +708,8 @@ if (streambuf_.size() == streambuf_.max_size()) { std::size_t bytes = 0; - boost::system::error_code ec(error::not_found); - handler_(ec, bytes); + boost::system::error_code errc(error::not_found); + handler_(errc, bytes); return; } @@ -877,8 +877,8 @@ if (streambuf_.size() == streambuf_.max_size()) { std::size_t bytes = 0; - boost::system::error_code ec(error::not_found); - handler_(ec, bytes); + boost::system::error_code errc(error::not_found); + handler_(errc, bytes); return; } Index: impl/io_service.ipp =================================================================== --- impl/io_service.ipp (revision 59528) +++ impl/io_service.ipp (working copy) @@ -147,8 +147,8 @@ return detail::wrapped_handler&lt;io_service&amp;, Handler&gt;(*this, handler); } -inline io_service::work::work(boost::asio::io_service&amp; io_service) - : io_service_(io_service) +inline io_service::work::work(boost::asio::io_service&amp; io_srv) + : io_service_(io_srv) { io_service_.impl_.work_started(); } Index: detail/reactive_socket_service.hpp =================================================================== --- detail/reactive_socket_service.hpp (revision 59528) +++ detail/reactive_socket_service.hpp (working copy) @@ -105,10 +105,10 @@ enum { max_buffers = 64 &lt; max_iov_len ? 64 : max_iov_len }; // Constructor. - reactive_socket_service(boost::asio::io_service&amp; io_service) + reactive_socket_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - reactive_socket_service&lt;Protocol, Reactor&gt; &gt;(io_service), - reactor_(boost::asio::use_service&lt;Reactor&gt;(io_service)) + reactive_socket_service&lt;Protocol, Reactor&gt; &gt;(ioservice), + reactor_(boost::asio::use_service&lt;Reactor&gt;(ioservice)) { reactor_.init_task(); } Index: detail/strand_service.hpp =================================================================== --- detail/strand_service.hpp (revision 59528) +++ detail/strand_service.hpp (working copy) @@ -285,8 +285,8 @@ }; // Construct a new strand service for the specified io_service. - explicit strand_service(boost::asio::io_service&amp; io_service) - : boost::asio::detail::service_base&lt;strand_service&gt;(io_service), + explicit strand_service(boost::asio::io_service&amp; ioservice) + : boost::asio::detail::service_base&lt;strand_service&gt;(ioservice), mutex_(), salt_(0) { Index: detail/hash_map.hpp =================================================================== --- detail/hash_map.hpp (revision 59528) +++ detail/hash_map.hpp (working copy) @@ -104,9 +104,9 @@ iterator it = buckets_[bucket].first; if (it == values_.end()) return values_.end(); - iterator end = buckets_[bucket].last; - ++end; - while (it != end) + iterator endit = buckets_[bucket].last; + ++endit; + while (it != endit) { if (it-&gt;first == k) return it; @@ -122,9 +122,9 @@ const_iterator it = buckets_[bucket].first; if (it == values_.end()) return it; - const_iterator end = buckets_[bucket].last; - ++end; - while (it != end) + const_iterator endit = buckets_[bucket].last; + ++endit; + while (it != endit) { if (it-&gt;first == k) return it; @@ -147,15 +147,15 @@ ++size_; return std::pair&lt;iterator, bool&gt;(buckets_[bucket].last, true); } - iterator end = buckets_[bucket].last; - ++end; - while (it != end) + iterator endit = buckets_[bucket].last; + ++endit; + while (it != endit) { if (it-&gt;first == v.first) return std::pair&lt;iterator, bool&gt;(it, false); ++it; } - buckets_[bucket].last = values_insert(end, v); + buckets_[bucket].last = values_insert(endit, v); ++size_; return std::pair&lt;iterator, bool&gt;(buckets_[bucket].last, true); } @@ -218,19 +218,19 @@ if (num_buckets == buckets_.size()) return; - iterator end = values_.end(); + iterator endit = values_.end(); // Update number of buckets and initialise all buckets to empty. buckets_.resize(num_buckets); for (std::size_t i = 0; i &lt; buckets_.size(); ++i) - buckets_[i].first = buckets_[i].last = end; + buckets_[i].first = buckets_[i].last = endit; // Put all values back into the hash. iterator iter = values_.begin(); - while (iter != end) + while (iter != endit) { std::size_t bucket = calculate_hash_value(iter-&gt;first) % buckets_.size(); - if (buckets_[bucket].last == end) + if (buckets_[bucket].last == endit) { buckets_[bucket].first = buckets_[bucket].last = iter++; } Index: detail/buffered_stream_storage.hpp =================================================================== --- detail/buffered_stream_storage.hpp (revision 59528) +++ detail/buffered_stream_storage.hpp (working copy) @@ -39,10 +39,10 @@ typedef std::size_t size_type; // Constructor. - explicit buffered_stream_storage(std::size_t capacity) + explicit buffered_stream_storage(std::size_t cap) : begin_offset_(0), end_offset_(0), - buffer_(capacity) + buffer_(cap) { } Index: detail/deadline_timer_service.hpp =================================================================== --- detail/deadline_timer_service.hpp (revision 59528) +++ detail/deadline_timer_service.hpp (working copy) @@ -148,8 +148,8 @@ ::timeval tv; tv.tv_sec = timeout.total_seconds(); tv.tv_usec = timeout.total_microseconds() % 1000000; - boost::system::error_code ec; - socket_ops::select(0, 0, 0, 0, &amp;tv, ec); + boost::system::error_code errc; + socket_ops::select(0, 0, 0, 0, &amp;tv, errc); now = Time_Traits::now(); } ec = boost::system::error_code(); Index: detail/epoll_reactor.hpp =================================================================== --- detail/epoll_reactor.hpp (revision 59528) +++ detail/epoll_reactor.hpp (working copy) @@ -62,8 +62,8 @@ }; // Constructor. - epoll_reactor(boost::asio::io_service&amp; io_service) - : boost::asio::detail::service_base&lt;epoll_reactor&lt;Own_Thread&gt; &gt;(io_service), + epoll_reactor(boost::asio::io_service&amp; ioservice) + : boost::asio::detail::service_base&lt;epoll_reactor&lt;Own_Thread&gt; &gt;(ioservice), mutex_(), epoll_fd_(do_epoll_create()), wait_in_progress_(false), @@ -650,12 +650,12 @@ // Cancel all operations associated with the given descriptor. The do_cancel // function of the handler objects will be invoked. This function does not // acquire the epoll_reactor's mutex. - void cancel_ops_unlocked(socket_type descriptor) + void cancel_ops_unlocked(socket_type socketdescriptor) { - bool interrupt = read_op_queue_.cancel_operations(descriptor); - interrupt = write_op_queue_.cancel_operations(descriptor) || interrupt; - interrupt = except_op_queue_.cancel_operations(descriptor) || interrupt; - if (interrupt) + bool intr = read_op_queue_.cancel_operations(socketdescriptor); + intr = write_op_queue_.cancel_operations(socketdescriptor) || intr; + intr = except_op_queue_.cancel_operations(socketdescriptor) || intr; + if (intr) interrupter_.interrupt(); } Index: detail/reactor_op_queue.hpp =================================================================== --- detail/reactor_op_queue.hpp (revision 59528) +++ detail/reactor_op_queue.hpp (working copy) @@ -325,11 +325,11 @@ // Construct an operation for the given descriptor. op_base(perform_func_type perform_func, complete_func_type complete_func, - destroy_func_type destroy_func, Descriptor descriptor) + destroy_func_type destroy_func, Descriptor desc) : perform_func_(perform_func), complete_func_(complete_func), destroy_func_(destroy_func), - descriptor_(descriptor), + descriptor_(desc), result_(), bytes_transferred_(0), next_(0) @@ -373,9 +373,9 @@ { public: // Constructor. - op(Descriptor descriptor, Operation operation) + op(Descriptor socketdescriptor, Operation operation) : op_base(&amp;op&lt;Operation&gt;::do_perform, &amp;op&lt;Operation&gt;::do_complete, - &amp;op&lt;Operation&gt;::do_destroy, descriptor), + &amp;op&lt;Operation&gt;::do_destroy, socketdescriptor), operation_(operation) { } Index: detail/reactive_descriptor_service.hpp =================================================================== --- detail/reactive_descriptor_service.hpp (revision 59528) +++ detail/reactive_descriptor_service.hpp (working copy) @@ -77,10 +77,10 @@ enum { max_buffers = 64 &lt; max_iov_len ? 64 : max_iov_len }; // Constructor. - reactive_descriptor_service(boost::asio::io_service&amp; io_service) + reactive_descriptor_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - reactive_descriptor_service&lt;Reactor&gt; &gt;(io_service), - reactor_(boost::asio::use_service&lt;Reactor&gt;(io_service)) + reactive_descriptor_service&lt;Reactor&gt; &gt;(ioservice), + reactor_(boost::asio::use_service&lt;Reactor&gt;(ioservice)) { reactor_.init_task(); } Index: detail/resolver_service.hpp =================================================================== --- detail/resolver_service.hpp (revision 59528) +++ detail/resolver_service.hpp (working copy) @@ -85,9 +85,9 @@ typedef typename Protocol::resolver_iterator iterator_type; // Constructor. - resolver_service(boost::asio::io_service&amp; io_service) + resolver_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - resolver_service&lt;Protocol&gt; &gt;(io_service), + resolver_service&lt;Protocol&gt; &gt;(ioservice), mutex_(), work_io_service_(new boost::asio::io_service), work_(new boost::asio::io_service::work(*work_io_service_)), Index: detail/service_base.hpp =================================================================== --- detail/service_base.hpp (revision 59528) +++ detail/service_base.hpp (working copy) @@ -33,8 +33,8 @@ static boost::asio::detail::service_id&lt;Type&gt; id; // Constructor. - service_base(boost::asio::io_service&amp; io_service) - : boost::asio::io_service::service(io_service) + service_base(boost::asio::io_service&amp; ioservice) + : boost::asio::io_service::service(ioservice) { } }; Index: detail/task_io_service.hpp =================================================================== --- detail/task_io_service.hpp (revision 59528) +++ detail/task_io_service.hpp (working copy) @@ -41,8 +41,8 @@ { public: // Constructor. - task_io_service(boost::asio::io_service&amp; io_service) - : boost::asio::detail::service_base&lt;task_io_service&lt;Task&gt; &gt;(io_service), + task_io_service(boost::asio::io_service&amp; ioservice) + : boost::asio::detail::service_base&lt;task_io_service&lt;Task&gt; &gt;(ioservice), mutex_(), task_(0), task_interrupted_(true), Index: detail/reactive_serial_port_service.hpp =================================================================== --- detail/reactive_serial_port_service.hpp (revision 59528) +++ detail/reactive_serial_port_service.hpp (working copy) @@ -52,11 +52,11 @@ typedef typename reactive_descriptor_service&lt;Reactor&gt;::implementation_type implementation_type; - reactive_serial_port_service(boost::asio::io_service&amp; io_service) + reactive_serial_port_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - reactive_serial_port_service&gt;(io_service), + reactive_serial_port_service&gt;(ioservice), descriptor_service_(boost::asio::use_service&lt; - reactive_descriptor_service&lt;Reactor&gt; &gt;(io_service)) + reactive_descriptor_service&lt;Reactor&gt; &gt;(ioservice)) { } Index: basic_datagram_socket.hpp =================================================================== --- basic_datagram_socket.hpp (revision 59528) +++ basic_datagram_socket.hpp (working copy) @@ -102,9 +102,9 @@ * * @throws boost::system::system_error Thrown on failure. */ - basic_datagram_socket(boost::asio::io_service&amp; io_service, + basic_datagram_socket(boost::asio::io_service&amp; ioservice, const endpoint_type&amp; endpoint) - : basic_socket&lt;Protocol, DatagramSocketService&gt;(io_service, endpoint) + : basic_socket&lt;Protocol, DatagramSocketService&gt;(ioservice, endpoint) { } Index: basic_streambuf.hpp =================================================================== --- basic_streambuf.hpp (revision 59528) +++ basic_streambuf.hpp (working copy) @@ -131,9 +131,9 @@ * of the streambuf's input sequence is 0. */ explicit basic_streambuf( - std::size_t max_size = (std::numeric_limits&lt;std::size_t&gt;::max)(), + std::size_t max_sz = (std::numeric_limits&lt;std::size_t&gt;::max)(), const Allocator&amp; allocator = Allocator()) - : max_size_(max_size), + : max_size_(max_sz), buffer_(allocator) { std::size_t pend = (std::min&lt;std::size_t&gt;)(max_size_, buffer_delta); Index: strand.hpp =================================================================== --- strand.hpp (revision 59528) +++ strand.hpp (working copy) @@ -87,9 +87,9 @@ * @param io_service The io_service object that the strand will use to * dispatch handlers that are ready to be run. */ - explicit strand(boost::asio::io_service&amp; io_service) + explicit strand(boost::asio::io_service&amp; ioservice) : service_(boost::asio::use_service&lt; - boost::asio::detail::strand_service&gt;(io_service)) + boost::asio::detail::strand_service&gt;(ioservice)) { service_.construct(impl_); } Index: posix/stream_descriptor_service.hpp =================================================================== --- posix/stream_descriptor_service.hpp (revision 59528) +++ posix/stream_descriptor_service.hpp (working copy) @@ -99,9 +99,9 @@ #endif /// Construct a new stream descriptor service for the specified io_service. - explicit stream_descriptor_service(boost::asio::io_service&amp; io_service) - : boost::asio::detail::service_base&lt;stream_descriptor_service&gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + explicit stream_descriptor_service(boost::asio::io_service&amp; ioservice) + : boost::asio::detail::service_base&lt;stream_descriptor_service&gt;(ioservice), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(ioservice)) { } Index: ip/address_v6.hpp =================================================================== --- ip/address_v6.hpp (revision 59528) +++ ip/address_v6.hpp (working copy) @@ -64,8 +64,8 @@ } /// Construct an address from raw bytes and scope ID. - explicit address_v6(const bytes_type&amp; bytes, unsigned long scope_id = 0) - : scope_id_(scope_id) + explicit address_v6(const bytes_type&amp; bytes, unsigned long scope = 0) + : scope_id_(scope) { #if UCHAR_MAX &gt; 0xFF for (std::size_t i = 0; i &lt; bytes.size(); ++i) Index: ip/basic_resolver.hpp =================================================================== --- ip/basic_resolver.hpp (revision 59528) +++ ip/basic_resolver.hpp (working copy) @@ -60,8 +60,8 @@ * @param io_service The io_service object that the resolver will use to * dispatch handlers for any asynchronous operations performed on the timer. */ - explicit basic_resolver(boost::asio::io_service&amp; io_service) - : basic_io_object&lt;ResolverService&gt;(io_service) + explicit basic_resolver(boost::asio::io_service&amp; ioservice) + : basic_io_object&lt;ResolverService&gt;(ioservice) { } Index: ip/basic_endpoint.hpp =================================================================== --- ip/basic_endpoint.hpp (revision 59528) +++ ip/basic_endpoint.hpp (working copy) @@ -91,11 +91,11 @@ * boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876); * @endcode */ - basic_endpoint(const InternetProtocol&amp; protocol, unsigned short port_num) + basic_endpoint(const InternetProtocol&amp; proto, unsigned short port_num) : data_() { using namespace std; // For memcpy. - if (protocol.family() == PF_INET) + if (proto.family() == PF_INET) { data_.v4.sin_family = AF_INET; data_.v4.sin_port = @@ -186,9 +186,9 @@ } /// Set the underlying size of the endpoint in the native type. - void resize(std::size_t size) + void resize(std::size_t s) { - if (size &gt; sizeof(boost::asio::detail::sockaddr_storage_type)) + if (s &gt; sizeof(boost::asio::detail::sockaddr_storage_type)) { boost::system::system_error e(boost::asio::error::invalid_argument); boost::throw_exception(e); Index: ip/resolver_service.hpp =================================================================== --- ip/resolver_service.hpp (revision 59528) +++ ip/resolver_service.hpp (working copy) @@ -68,10 +68,10 @@ #endif /// Construct a new resolver service for the specified io_service. - explicit resolver_service(boost::asio::io_service&amp; io_service) + explicit resolver_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - resolver_service&lt;InternetProtocol&gt; &gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + resolver_service&lt;InternetProtocol&gt; &gt;(ioservice), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(ioservice)) { } Index: ip/basic_resolver_entry.hpp =================================================================== --- ip/basic_resolver_entry.hpp (revision 59528) +++ ip/basic_resolver_entry.hpp (working copy) @@ -50,11 +50,11 @@ } /// Construct with specified endpoint, host name and service name. - basic_resolver_entry(const endpoint_type&amp; endpoint, - const std::string&amp; host_name, const std::string&amp; service_name) - : endpoint_(endpoint), - host_name_(host_name), - service_name_(service_name) + basic_resolver_entry(const endpoint_type&amp; endp, + const std::string&amp; hostname, const std::string&amp; servicename) + : endpoint_(endp), + host_name_(hostname), + service_name_(servicename) { } Index: ip/tcp.hpp =================================================================== --- ip/tcp.hpp (revision 59528) +++ ip/tcp.hpp (working copy) @@ -145,8 +145,8 @@ private: // Construct with a specific family. - explicit tcp(int family) - : family_(family) + explicit tcp(int fam) + : family_(fam) { } Index: ip/basic_resolver_query.hpp =================================================================== --- ip/basic_resolver_query.hpp (revision 59528) +++ ip/basic_resolver_query.hpp (working copy) @@ -47,11 +47,11 @@ typedef InternetProtocol protocol_type; /// Construct with specified service name for any protocol. - basic_resolver_query(const std::string&amp; service_name, + basic_resolver_query(const std::string&amp; servicename, int flags = passive | address_configured) : hints_(), host_name_(), - service_name_(service_name) + service_name_(servicename) { typename InternetProtocol::endpoint endpoint; hints_.ai_flags = flags; @@ -66,11 +66,11 @@ /// Construct with specified service name for a given protocol. basic_resolver_query(const protocol_type&amp; protocol, - const std::string&amp; service_name, + const std::string&amp; servicename, int flags = passive | address_configured) : hints_(), host_name_(), - service_name_(service_name) + service_name_(servicename) { hints_.ai_flags = flags; hints_.ai_family = protocol.family(); @@ -83,11 +83,11 @@ } /// Construct with specified host name and service name for any protocol. - basic_resolver_query(const std::string&amp; host_name, - const std::string&amp; service_name, int flags = address_configured) + basic_resolver_query(const std::string&amp; hostname, + const std::string&amp; servicename, int flags = address_configured) : hints_(), - host_name_(host_name), - service_name_(service_name) + host_name_(hostname), + service_name_(servicename) { typename InternetProtocol::endpoint endpoint; hints_.ai_flags = flags; @@ -102,11 +102,11 @@ /// Construct with specified host name and service name for a given protocol. basic_resolver_query(const protocol_type&amp; protocol, - const std::string&amp; host_name, const std::string&amp; service_name, + const std::string&amp; hostname, const std::string&amp; servicename, int flags = address_configured) : hints_(), - host_name_(host_name), - service_name_(service_name) + host_name_(hostname), + service_name_(servicename) { hints_.ai_flags = flags; hints_.ai_family = protocol.family(); Index: ip/udp.hpp =================================================================== --- ip/udp.hpp (revision 59528) +++ ip/udp.hpp (working copy) @@ -101,8 +101,8 @@ private: // Construct with a specific family. - explicit udp(int family) - : family_(family) + explicit udp(int fam) + : family_(fam) { } Index: ip/icmp.hpp =================================================================== --- ip/icmp.hpp (revision 59528) +++ ip/icmp.hpp (working copy) @@ -101,9 +101,9 @@ private: // Construct with a specific family. - explicit icmp(int protocol, int family) - : protocol_(protocol), - family_(family) + explicit icmp(int proto, int fam) + : protocol_(proto), + family_(fam) { } Index: stream_socket_service.hpp =================================================================== --- stream_socket_service.hpp (revision 59528) +++ stream_socket_service.hpp (working copy) @@ -100,10 +100,10 @@ #endif /// Construct a new stream socket service for the specified io_service. - explicit stream_socket_service(boost::asio::io_service&amp; io_service) + explicit stream_socket_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - stream_socket_service&lt;Protocol&gt; &gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + stream_socket_service&lt;Protocol&gt; &gt;(ioservice), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(ioservice)) { } Index: socket_acceptor_service.hpp =================================================================== --- socket_acceptor_service.hpp (revision 59528) +++ socket_acceptor_service.hpp (working copy) @@ -96,10 +96,10 @@ #endif /// Construct a new socket acceptor service for the specified io_service. - explicit socket_acceptor_service(boost::asio::io_service&amp; io_service) + explicit socket_acceptor_service(boost::asio::io_service&amp; ioservice) : boost::asio::detail::service_base&lt; - socket_acceptor_service&lt;Protocol&gt; &gt;(io_service), - service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(io_service)) + socket_acceptor_service&lt;Protocol&gt; &gt;(ioservice), + service_impl_(boost::asio::use_service&lt;service_impl_type&gt;(ioservice)) { } </pre><p> After making these local changes, asio code compiles fine for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 18 Mar 2010 00:30:14 GMT</pubDate> <title>severity, milestone changed https://svn.boost.org/trac10/ticket/3905#comment:2 https://svn.boost.org/trac10/ticket/3905#comment:2 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Cosmetic</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Will look at this once I finally remove the deprecated member functions named 'io_service()'. </p> Ticket chris_kohlhoff Wed, 23 Feb 2011 01:06:36 GMT <link>https://svn.boost.org/trac10/ticket/3905#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3905#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/69194" title="Changes for asio version 1.5.0: * Added support for timeouts on ...">[69194]</a>) Changes for asio version 1.5.0: </p> <ul><li>Added support for timeouts on socket iostreams, such as ip::tcp::iostream. A timeout is set by calling expires_at() or expires_from_now() to establish a deadline. Any socket operations which occur past the deadline will put the iostream into a bad state. </li></ul><ul><li>Added a new error() member function to socket iostreams, for retrieving the error code from the most recent system call. </li></ul><ul><li>Added a new basic_deadline_timer::cancel_one() function. This function lets you cancel a single waiting handler on a timer. Handlers are cancelled in FIFO order. </li></ul><ul><li>Added a new transfer_exactly() completion condition. This can be used to send or receive a specified number of bytes even if the total size of the buffer (or buffer sequence) is larger. </li></ul><ul><li>Added new free functions connect() and async_connect(). These operations try each endpoint in a list until the socket is successfully connected. </li></ul><ul><li>Extended the buffer_size() function so that it works for buffer sequences in addition to individual buffers. </li></ul><ul><li>Added a new buffer_copy() function that can be used to copy the raw bytes between individual buffers and buffer sequences. </li></ul><ul><li>Added new non-throwing overloads of read(), read_at(), write() and write_at() that do not require a completion condition. </li></ul><ul><li>Added friendlier compiler errors for when a completion handler does not meet the necessary type requirements. When C++0x is available (currently supported for g++ 4.5 or later, and MSVC 10), static_assert is also used to generate an informative error message. Checking may be disabled by defining BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS. </li></ul><ul><li>Made the is_loopback(), is_unspecified() and is_multicast() functions consistently available across the ip::address, ip::address_v4 and ip::address_v6 classes. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3939" title="#3939: Feature Requests: Determination on wither ip::address is a multicast address (closed: fixed)">#3939</a>. </li></ul><ul><li>Added new non_blocking() functions for managing the non-blocking behaviour of a socket or descriptor. The io_control() commands named non_blocking_io are now deprecated in favour of these new functions. </li></ul><ul><li>Added new native_non_blocking() functions for managing the non-blocking mode of the underlying socket or descriptor. These functions are intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The functions have no effect on the behaviour of the synchronous operations of the socket or descriptor. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3307" title="#3307: Bugs: Stream descriptor blocking state set on close (closed: fixed)">#3307</a>. </li></ul><ul><li>Added the io_control() member function for socket acceptors. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3297" title="#3297: Bugs: io_control not exposed on tcp::connector in asio (closed: fixed)">#3297</a>. </li></ul><ul><li>For consistency with the C++0x standard library, deprecated the native_type typedefs in favour of native_handle_type, and the native() member functions in favour of native_handle(). </li></ul><ul><li>Added a release() member function to posix descriptors. This function releases ownership of the underlying native descriptor to the caller. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3900" title="#3900: Feature Requests: Request for support of &#34;release&#34; member function or assign without ... (closed: fixed)">#3900</a>. </li></ul><ul><li>Added support for sequenced packet sockets (SOCK_SEQPACKET). </li></ul><ul><li>Added a new io_service::stopped() function that can be used to determine whether the io_service has stopped (i.e. a reset() call is needed prior to any further calls to run(), run_one(), poll() or poll_one()). </li></ul><ul><li>Reduced the copying of handler function objects. </li></ul><ul><li>Added support for C++0x move construction to further reduce copying of handler objects. Move support is enabled when compiling in -std=c++0x mode on g++ 4.5 or higher, or when using MSVC10. </li></ul><ul><li>Removed the dependency on OS-provided macros for the well-known IPv4 and IPv6 addresses. This should eliminate the annoying "missing braces around initializer" warnings. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3741" title="#3741: Bugs: asio::ip::address_v6.hpp: Missing braces around anonymous union (closed: fixed)">#3741</a>. </li></ul><ul><li>Reduced the size of ip::basic_endpoint&lt;&gt; objects (such as ip::tcp::endpoint and ip::udp::endpoint). </li></ul><ul><li>Changed the reactor backends to assume that any descriptors or sockets added using assign() may have been dup()-ed, and so require explicit deregistration from the reactor. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4971" title="#4971: Bugs: stream_descriptor not remove descriptor from epoll_reactor (closed: fixed)">#4971</a>. </li></ul><ul><li>Changed the SSL error category to return error strings from the OpenSSL library. </li></ul><ul><li>Changed the separate compilation support such that, to use Asio's SSL capabilities, you should also include 'asio/ssl/impl/src.hpp in one source file in your program. </li></ul><ul><li>Removed the deprecated member functions named io_service(). The get_io_service() member functions should be used instead. </li></ul><ul><li>Removed the deprecated typedefs resolver_query and resolver_iterator from the ip::tcp, ip::udp and ip::icmp classes. </li></ul><ul><li>Fixed a compile error on some versions of g++ due to anonymous enums. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4883" title="#4883: Patches: epoll_reactor.hpp doesn`t compile with some versions of gcc (closed: fixed)">#4883</a>. </li></ul><ul><li>Added an explicit cast to the FIONBIO constant to int to suppress a compiler warning on some platforms. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5128" title="#5128: Bugs: Implicit constant overflow in non_blocking_io::name() (closed: fixed)">#5128</a>. </li></ul><ul><li>Fixed warnings reported by g++'s -Wshadow compiler option. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3905" title="#3905: Bugs: asio boost headers fail with g++-4.3.2 and -Wshadow -Werror (closed: fixed)">#3905</a>. </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 06 Jun 2011 01:45:57 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3905#comment:4 https://svn.boost.org/trac10/ticket/3905#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed on release branch as of <a class="changeset" href="https://svn.boost.org/trac10/changeset/72428" title="Merge asio from trunk.">[72428]</a>. </p> Ticket