summaryrefslogtreecommitdiff
path: root/src/mmo/core.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-30 19:30:49 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-30 20:57:13 -0700
commitaa4df026d44bd205f8bfce8a3b8d6a1144332f32 (patch)
tree397692da57b2be8f7c083989ed37fb03308d5b2c /src/mmo/core.cpp
parent7c5c2058e9aea996dc6c76a7e6d9ba4fc2a2bc77 (diff)
downloadtmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.gz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.bz2
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.xz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.zip
Finally get around to decoupling the warning system
Diffstat (limited to 'src/mmo/core.cpp')
-rw-r--r--src/mmo/core.cpp30
1 files changed, 17 insertions, 13 deletions
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);