fix a few warnings and GCC build

This commit is contained in:
Arvid Norberg 2015-04-18 13:56:36 +00:00
parent cea9564302
commit 23536dcc42
3 changed files with 7 additions and 5 deletions

View File

@ -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__

View File

@ -389,7 +389,10 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#include <limits.h>
#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

View File

@ -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);
}