From 2f94539545b176a7dc2981b1a932b8428e33eaa7 Mon Sep 17 00:00:00 2001 From: gumi Date: Thu, 10 Jan 2019 18:30:38 -0500 Subject: drop support for gcc-5, gcc-6, clang-4, clang-5 in travis and fix some misc issues --- src/char/char.hpp | 8 ++++---- src/diagnostics.hpp | 2 +- src/io/cxxstdio.hpp | 16 ++++++++-------- src/login/login.cpp | 6 +++--- src/map/map.hpp | 8 ++++---- src/map/script-fun.cpp | 2 ++ src/warnings.hpp | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/char/char.hpp b/src/char/char.hpp index 1151750..ab74507 100644 --- a/src/char/char.hpp +++ b/src/char/char.hpp @@ -71,10 +71,10 @@ void char_log(XString line); #define CHAR_LOG(fmt, ...) \ char_log(STRPRINTF(fmt, ## __VA_ARGS__)) -#define CHAR_LOG_AND_ECHO(...) \ - do { \ - PRINTF(__VA_ARGS__); \ - CHAR_LOG(__VA_ARGS__); \ +#define CHAR_LOG_AND_ECHO(...) \ + do { \ + PRINTF(__VA_ARGS__); \ + CHAR_LOG(__VA_ARGS__); \ } while (0) } // namespace char_ } // namespace tmwa diff --git a/src/diagnostics.hpp b/src/diagnostics.hpp index 4185334..3a10505 100644 --- a/src/diagnostics.hpp +++ b/src/diagnostics.hpp @@ -771,7 +771,7 @@ namespace tmwa /// Warn when a noexcept expression evaluates to /// false even though the expression can't actually /// throw -#define DIAG_noexcept "-Wnoexcept" +#define DIAG_noexcept "-Wno-noexcept-type -Wnoexcept" #if GCC # define HAS_DIAG_noexcept 1 #else diff --git a/src/io/cxxstdio.hpp b/src/io/cxxstdio.hpp index 7312382..08c9a53 100644 --- a/src/io/cxxstdio.hpp +++ b/src/io/cxxstdio.hpp @@ -81,14 +81,14 @@ namespace cxxstdio } }; -#define XPRINTF(out, fmt, ...) \ - ({ \ - struct format_impl \ - { \ - constexpr static \ - FormatString print_format() { return fmt; } \ - }; \ - cxxstdio::PrintFormatter::print(out, ## __VA_ARGS__); \ +#define XPRINTF(out, fmt, ...) \ + ({ \ + struct format_impl \ + { \ + constexpr static \ + FormatString print_format() __asm__("_print_format") { return fmt; } \ + }; \ + cxxstdio::PrintFormatter::print(out, ## __VA_ARGS__); \ }) #define FPRINTF(file, fmt, ...) XPRINTF(/*no_cast*/(file), fmt, ## __VA_ARGS__) diff --git a/src/login/login.cpp b/src/login/login.cpp index 68898ca..8e2c776 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -145,9 +145,9 @@ struct mmo_account #define LOGIN_LOG(fmt, ...) \ tmwa::login::login_log(STRPRINTF(fmt, ## __VA_ARGS__)) #define LOGIN_LOG_AND_ECHO(...) \ - do { \ - PRINTF(__VA_ARGS__); \ - LOGIN_LOG(__VA_ARGS__); \ + do { \ + PRINTF(__VA_ARGS__); \ + LOGIN_LOG(__VA_ARGS__); \ } while (0) static void login_log(XString line) diff --git a/src/map/map.hpp b/src/map/map.hpp index 2f6ef21..60b3462 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -584,10 +584,10 @@ void map_log(XString line); #define MAP_LOG(format, ...) \ map_log(STRPRINTF(format, ## __VA_ARGS__)) -#define MAP_LOG_AND_ECHO(...) \ - do { \ - PRINTF(__VA_ARGS__); \ - MAP_LOG(__VA_ARGS__); \ +#define MAP_LOG_AND_ECHO(...) \ + do { \ + PRINTF(__VA_ARGS__); \ + MAP_LOG(__VA_ARGS__); \ } while (0) #define MAP_LOG_PC(sd, fmt, ...) \ diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 8292bdb..ab60535 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -4150,8 +4150,10 @@ void builtin_npcareawarp(ScriptState *st) } } else + { x = random_::in(x0, x1); y = random_::in(y0, y1); + } npc_enable(npc, 0); map_delblock(nd); /* [Freeyorp] */ diff --git a/src/warnings.hpp b/src/warnings.hpp index 8f545e3..9f4605b 100644 --- a/src/warnings.hpp +++ b/src/warnings.hpp @@ -33,7 +33,7 @@ PRAGMA(GCC diagnostic warning "-Wextra"); PRAGMA(GCC diagnostic warning "-Wunused"); PRAGMA(GCC diagnostic warning "-Wformat"); -DIAG_E(abi); +DIAG_W(abi); DIAG_I(abi_tag); DIAG_E(address); DIAG_I(aggregate_return); -- cgit v1.2.3-70-g09d2