diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-06-11 21:55:13 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-06-11 23:27:33 -0700 |
commit | 8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13 (patch) | |
tree | 15e8a4841af992e17794f26fc7991ed40c35bd51 /src/common/core.cpp | |
parent | 8c6072df499ef9068346fbe8313b63dbba1e4e82 (diff) | |
download | tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.gz tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.bz2 tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.tar.xz tmwa-8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13.zip |
Allegedly remove all manual memory management
Diffstat (limited to 'src/common/core.cpp')
-rw-r--r-- | src/common/core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/core.cpp b/src/common/core.cpp index 994de93..153414d 100644 --- a/src/common/core.cpp +++ b/src/common/core.cpp @@ -36,7 +36,10 @@ 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" return SIG_ERR; +#pragma GCC diagnostic pop return oact.sa_handler; } @@ -50,7 +53,10 @@ static __attribute__((noreturn)) void sig_proc(int) { for (int i = 1; i < 31; ++i) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" compat_signal(i, SIG_IGN); +#pragma GCC diagnostic pop term_func(); _exit(0); } @@ -74,17 +80,23 @@ 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" compat_signal(SIGPIPE, SIG_IGN); +#pragma GCC diagnostic 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" 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 atexit(term_func); |