I am running Windows 7.1 64-bit, Boost 1.58.0, and (recently) MinGW 5.1.0 64-bit.
When I was previously running MinGW 4.9.2, I used the following
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#include "boost/asio/ip/host_name.hpp" // for host_name()
#pragma GCC diagnostic pop
to suppress unnecessary warnings, and it worked--most of the time. If there was a legitimate error in the code, these suppressed warning showed up anyway--but I can live with that.
Yesterday, I upgraded to MinGW 5.1.0 64-bit. The pragmas shown above no longer seem to be suppressing warnings. I couldn't find anything on Google that would suggest anything has changed.
I really would like to have this feature working again since I'm using Boost Test that has dozens of "std::auto_ptr is deprecated" warnings.
Looking at the error:
You can see the compiler flag is no longer
-Wunused-variable
but now-Wdeprecated-declarations
. Reflecting that in the #pragma made it work again for me.