diff --git a/CRT.c b/CRT.c index d6390ab6..14d9ae62 100644 --- a/CRT.c +++ b/CRT.c @@ -513,6 +513,7 @@ int CRT_colorScheme = 0; void *backtraceArray[128]; +ATTR_NORETURN static void CRT_handleSIGTERM(int sgn) { (void) sgn; CRT_done(); diff --git a/XAlloc.h b/XAlloc.h index 3a2c658c..cebe095c 100644 --- a/XAlloc.h +++ b/XAlloc.h @@ -5,11 +5,13 @@ #define _GNU_SOURCE #endif +#include "Macros.h" + #include #include #include -void fail(void); +void fail(void) ATTR_NORETURN; void* xMalloc(size_t size); diff --git a/darwin/DarwinCRT.c b/darwin/DarwinCRT.c index 2191f307..da16913d 100644 --- a/darwin/DarwinCRT.c +++ b/darwin/DarwinCRT.c @@ -6,6 +6,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "DarwinCRT.h" #include "CRT.h" #include #include diff --git a/darwin/DarwinCRT.h b/darwin/DarwinCRT.h index 5e08422b..663bd8b0 100644 --- a/darwin/DarwinCRT.h +++ b/darwin/DarwinCRT.h @@ -7,6 +7,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif diff --git a/dragonflybsd/DragonFlyBSDCRT.c b/dragonflybsd/DragonFlyBSDCRT.c index a0920833..4d355ae9 100644 --- a/dragonflybsd/DragonFlyBSDCRT.c +++ b/dragonflybsd/DragonFlyBSDCRT.c @@ -7,6 +7,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "DragonFlyBSDCRT.h" #include "CRT.h" #include #include diff --git a/dragonflybsd/DragonFlyBSDCRT.h b/dragonflybsd/DragonFlyBSDCRT.h index 2bf85f71..bf5384db 100644 --- a/dragonflybsd/DragonFlyBSDCRT.h +++ b/dragonflybsd/DragonFlyBSDCRT.h @@ -8,6 +8,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif diff --git a/freebsd/FreeBSDCRT.c b/freebsd/FreeBSDCRT.c index 49cc5d0d..b0a0f607 100644 --- a/freebsd/FreeBSDCRT.c +++ b/freebsd/FreeBSDCRT.c @@ -1,11 +1,12 @@ /* -htop - UnsupportedCRT.c +htop - FreeBSDCRT.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" +#include "FreeBSDCRT.h" #include "CRT.h" #include #include diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h index eb88fcc1..3ab802d9 100644 --- a/freebsd/FreeBSDCRT.h +++ b/freebsd/FreeBSDCRT.h @@ -1,12 +1,14 @@ #ifndef HEADER_FreeBSDCRT #define HEADER_FreeBSDCRT /* -htop - UnsupportedCRT.h +htop - FreeBSDCRT.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif diff --git a/htop.c b/htop.c index 941c6b83..a7b37acb 100644 --- a/htop.c +++ b/htop.c @@ -29,11 +29,13 @@ in the source distribution for its full text. //#link m +ATTR_NORETURN static void printVersionFlag(void) { fputs("htop " VERSION "\n", stdout); exit(0); } +ATTR_NORETURN static void printHelpFlag(void) { fputs("htop " VERSION "\n" "Released under the GNU GPL.\n\n" diff --git a/linux/LinuxCRT.c b/linux/LinuxCRT.c index dbfad27f..2679d4f6 100644 --- a/linux/LinuxCRT.c +++ b/linux/LinuxCRT.c @@ -6,6 +6,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "LinuxCRT.h" #include "CRT.h" #include diff --git a/linux/LinuxCRT.h b/linux/LinuxCRT.h index c379a8f6..2adb9f3f 100644 --- a/linux/LinuxCRT.h +++ b/linux/LinuxCRT.h @@ -7,6 +7,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ +#include "Macros.h" + void CRT_handleSIGSEGV(int sgn); #endif diff --git a/openbsd/OpenBSDCRT.c b/openbsd/OpenBSDCRT.c index 233d30c9..8f026e3e 100644 --- a/openbsd/OpenBSDCRT.c +++ b/openbsd/OpenBSDCRT.c @@ -1,5 +1,5 @@ /* -htop - UnsupportedCRT.c +htop - OpenBSDCRT.c (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file @@ -7,6 +7,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "OpenBSDCRT.h" #include "CRT.h" #include #include diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h index 85860a96..74535bee 100644 --- a/openbsd/OpenBSDCRT.h +++ b/openbsd/OpenBSDCRT.h @@ -1,13 +1,15 @@ #ifndef HEADER_OpenBSDCRT #define HEADER_OpenBSDCRT /* -htop - UnsupportedCRT.h +htop - OpenBSDCRT.h (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif diff --git a/solaris/SolarisCRT.c b/solaris/SolarisCRT.c index 13e82d7c..bea7d377 100644 --- a/solaris/SolarisCRT.c +++ b/solaris/SolarisCRT.c @@ -7,6 +7,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "SolarisCRT.h" #include "CRT.h" #include #include diff --git a/solaris/SolarisCRT.h b/solaris/SolarisCRT.h index 4e37b7f6..d9ab7208 100644 --- a/solaris/SolarisCRT.h +++ b/solaris/SolarisCRT.h @@ -8,6 +8,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif diff --git a/unsupported/UnsupportedCRT.c b/unsupported/UnsupportedCRT.c index 49cc5d0d..f5c8fef1 100644 --- a/unsupported/UnsupportedCRT.c +++ b/unsupported/UnsupportedCRT.c @@ -6,6 +6,7 @@ in the source distribution for its full text. */ #include "config.h" +#include "UnsupportedCRT.h" #include "CRT.h" #include #include diff --git a/unsupported/UnsupportedCRT.h b/unsupported/UnsupportedCRT.h index 24d63e5c..cb248f80 100644 --- a/unsupported/UnsupportedCRT.h +++ b/unsupported/UnsupportedCRT.h @@ -7,6 +7,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -void CRT_handleSIGSEGV(int sgn); +#include "Macros.h" + +void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; #endif