From aa4df026d44bd205f8bfce8a3b8d6a1144332f32 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 30 Jun 2014 19:30:49 -0700 Subject: Finally get around to decoupling the warning system --- src/mmo/core.cpp | 30 +++++++++++++++++------------- src/mmo/extract_test.cpp | 2 -- src/mmo/human_time_diff_test.cpp | 2 -- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/mmo') diff --git a/src/mmo/core.cpp b/src/mmo/core.cpp index 444a44c..2264ec6 100644 --- a/src/mmo/core.cpp +++ b/src/mmo/core.cpp @@ -62,10 +62,12 @@ sigfunc compat_signal(int signo, sigfunc func) sact.sa_flags = 0; if (sigaction(signo, &sact, &oact) < 0) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" + { + DIAG_PUSH(); + DIAG_I(old_style_cast); return SIG_ERR; -#pragma GCC diagnostic pop + DIAG_POP(); + } return oact.sa_handler; } @@ -82,10 +84,12 @@ static void sig_proc(int) { for (int i = 1; i < 31; ++i) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" + { + DIAG_PUSH(); + DIAG_I(old_style_cast); compat_signal(i, SIG_IGN); -#pragma GCC diagnostic pop + DIAG_POP(); + } runflag = false; } @@ -117,24 +121,24 @@ int main(int argc, char **argv) // set up exit handlers *after* the initialization has happened. // This is because term_func is likely to depend on successful init. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" + DIAG_PUSH(); + DIAG_I(old_style_cast); compat_signal(SIGPIPE, SIG_IGN); -#pragma GCC diagnostic pop + DIAG_POP(); compat_signal(SIGTERM, sig_proc); compat_signal(SIGINT, sig_proc); compat_signal(SIGCHLD, chld_proc); // Signal to create coredumps by system when necessary (crash) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + DIAG_PUSH(); + DIAG_I(old_style_cast); + DIAG_I(zero_as_null_pointer_constant); compat_signal(SIGSEGV, SIG_DFL); compat_signal(SIGBUS, SIG_DFL); compat_signal(SIGTRAP, SIG_DFL); compat_signal(SIGILL, SIG_DFL); compat_signal(SIGFPE, SIG_DFL); -#pragma GCC diagnostic pop + DIAG_POP(); atexit(term_func); diff --git a/src/mmo/extract_test.cpp b/src/mmo/extract_test.cpp index 0116f6c..e6dc7b2 100644 --- a/src/mmo/extract_test.cpp +++ b/src/mmo/extract_test.cpp @@ -29,8 +29,6 @@ namespace tmwa { -#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - TEST(extract, record_int) { int x, y, z; diff --git a/src/mmo/human_time_diff_test.cpp b/src/mmo/human_time_diff_test.cpp index 590e2b3..c18599d 100644 --- a/src/mmo/human_time_diff_test.cpp +++ b/src/mmo/human_time_diff_test.cpp @@ -25,8 +25,6 @@ namespace tmwa { -#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - // a sequence of [-+]?[0-9]+([ay]|m|[jd]|h|mn|s) TEST(humantimediff, single) -- cgit v1.2.3-70-g09d2