diff --git a/include/libtorrent/aux_/disable_warnings_push.hpp b/include/libtorrent/aux_/disable_warnings_push.hpp index 68c6b3bf8..f559e158c 100644 --- a/include/libtorrent/aux_/disable_warnings_push.hpp +++ b/include/libtorrent/aux_/disable_warnings_push.hpp @@ -36,13 +36,12 @@ POSSIBILITY OF SUCH DAMAGE. #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wswitch-enum" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wundef" -#pragma GCC diagnostic ignored "-Wweak-vtables" #pragma GCC diagnostic ignored "-Wmissing-noreturn" #pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index c31c1126b..cdb9dbf69 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -389,7 +389,10 @@ int snprintf(char* buf, int len, char const* fmt, ...) #include #endif -#if defined __cplusplus && __cplusplus >= 199711L +// at the highest warning level, clang actually warns about functions +// that could be marked noreturn. There seems to be versions of GCC +// that declare being +#if defined __clang__ && defined __cplusplus && __cplusplus >= 199711L #define TORRENT_NO_RETURN [[noreturn]] #else #define TORRENT_NO_RETURN diff --git a/src/error_code.cpp b/src/error_code.cpp index 79fb7c401..211a93d88 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -326,7 +326,7 @@ namespace libtorrent #endif #ifndef BOOST_NO_EXCEPTIONS - const char* libtorrent_exception::what() const throw() + const char* libtorrent_exception::what() const BOOST_SYSTEM_NOEXCEPT { if (!m_msg) { @@ -337,7 +337,7 @@ namespace libtorrent return m_msg; } - libtorrent_exception::~libtorrent_exception() throw() + libtorrent_exception::~libtorrent_exception() BOOST_SYSTEM_NOEXCEPT { free(m_msg); }