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 --- .travis.yml | 38 ++++++++++++++++++++------------------ 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 +- tools/protocol.py | 6 +++--- 9 files changed, 46 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ba69f0..e18211f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ notifications: ## Use the container-based infrastructure sudo: required -dist: trusty +dist: xenial python: - 2.7 @@ -48,66 +48,68 @@ matrix: fast-finish: true include: - compiler: clang - env: REAL_CC=clang-4.0 REAL_CXX=clang++-4.0 + env: REAL_CC=clang-6.0 REAL_CXX=clang++-6.0 addons: apt: sources: - - llvm-toolchain-trusty-4.0 + - llvm-toolchain-xenial-6.0 - ubuntu-toolchain-r-test packages: - - clang-4.0 - - libstdc++6-5-dbg + - clang-6.0 + - libstdc++6-6-dbg - libgtest-dev - valgrind - gdb - compiler: clang - env: REAL_CC=clang-5.0 REAL_CXX=clang++-5.0 + env: REAL_CC=clang-7 REAL_CXX=clang++-7 addons: apt: sources: - - llvm-toolchain-trusty-5.0 + - llvm-toolchain-xenial-7 - ubuntu-toolchain-r-test packages: - - clang-5.0 - - libstdc++6-6-dbg + - clang-7 + - libstdc++6-7-dbg - libgtest-dev - valgrind - gdb - compiler: gcc - env: REAL_CC=gcc-5 REAL_CXX=g++-5 LDFLAGS="-fuse-ld=gold" + env: REAL_CC=gcc-7 REAL_CXX=g++-7 LDFLAGS="-fuse-ld=gold" addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-5 - - libstdc++6-5-dbg + - g++-7 + - libstdc++6-7-dbg - libgtest-dev - valgrind - gdb - compiler: gcc - env: REAL_CC=gcc-6 REAL_CXX=g++-6 LDFLAGS="-fuse-ld=gold" + env: REAL_CC=gcc-8 REAL_CXX=g++-8 LDFLAGS="-fuse-ld=gold" addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-6 - - libstdc++6-6-dbg + - g++-8 + - libstdc++6-8-dbg - libgtest-dev - valgrind - gdb - compiler: gcc - env: REAL_CC=gcc-6 REAL_CXX=g++-6 REAL_EXTRA=-fsanitize=address FORCE_TESTER='' ASAN_OPTIONS=detect_leaks=0 LDFLAGS="-fuse-ld=gold" + env: REAL_CC=gcc-8 REAL_CXX=g++-8 REAL_EXTRA=-fsanitize=address FORCE_TESTER='' ASAN_OPTIONS=detect_leaks=0 LDFLAGS="-fuse-ld=gold" addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-6 - - libstdc++6-6-dbg + - g++-8 + - libstdc++6-8-dbg - libgtest-dev - gdb + allow_failures: # got no time to deal with gcc right now + - compiler: gcc # everything that was pushed to stable was already on 'master', except # the version change and some doc changes. 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); diff --git a/tools/protocol.py b/tools/protocol.py index 413bb67..df6e2fb 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -1992,7 +1992,7 @@ def build_context(): ], fixed_size=17, pre=[0x0069, 0x0092, 0x00b3], - post=[0x006b, 0x006c, 0x2712, 0x2715, 0x2716], + post=[0x006b, 0x006c, 0x2712, 0x2715, 0x2716, 0x2742], desc=''' Begin connection to the char server, based on keys the login server gave us. @@ -2117,7 +2117,7 @@ def build_context(): at(0, char_select, 'char select'), ], repeat_size=106, - pre=[0x0065, 0x2713, 0x2715], + pre=[0x0065, 0x2713, 0x2715, 0x2742], post=[PRETTY], xpost=[0x0066, 0x0067, 0x0068], desc=''' @@ -2131,7 +2131,7 @@ def build_context(): at(2, u8, 'code'), ], fixed_size=3, - pre=[0x0065, 0x2713, 0x2715], + pre=[0x0065, 0x2713, 0x2715, 0x2742], post=[PRETTY], desc=''' Refuse connection. -- cgit v1.2.3-60-g2f50