Opened 6 years ago

Last modified 6 years ago

#12502 new Bugs

boost/asio/error.hpp: fix warnings about unused static variables

Reported by: bachmann@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

Please add the following pre-processor define (or similar) around the static variables in "boost/asio/error.hpp" such that the warnings about unused variables can be switched off in client code.

Analog to boost/system/error_code.hpp:

#ifndef BOOST_SYSTEM_NO_DEPRECATED static const boost::system::error_category& system_category

boost::asio::error::get_system_category();

static const boost::system::error_category& netdb_category

boost::asio::error::get_netdb_category();

static const boost::system::error_category& addrinfo_category

boost::asio::error::get_addrinfo_category();

static const boost::system::error_category& misc_category

boost::asio::error::get_misc_category();

#endif

Change History (1)

comment:1 by anonymous, 6 years ago

I can reproduce it also with the latest boost 1_63_0 with gcc-5.2.0 with the following flags: -std=c++11 -O3 -Wall -W -Werror

The warning does not appear when I don't use the -O3 flag.

Note: See TracTickets for help on using tickets.