mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Mark noreturn functions
This commit is contained in:
parent
b85a31415e
commit
e719a85994
1
CRT.c
1
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();
|
||||
|
4
XAlloc.h
4
XAlloc.h
@ -5,11 +5,13 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include "Macros.h"
|
||||
|
||||
#include <err.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void fail(void);
|
||||
void fail(void) ATTR_NORETURN;
|
||||
|
||||
void* xMalloc(size_t size);
|
||||
|
||||
|
@ -6,6 +6,7 @@ in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "DarwinCRT.h"
|
||||
#include "CRT.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
@ -7,6 +7,7 @@ in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "DragonFlyBSDCRT.h"
|
||||
#include "CRT.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
@ -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 <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
2
htop.c
2
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"
|
||||
|
@ -6,6 +6,7 @@ in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "LinuxCRT.h"
|
||||
#include "CRT.h"
|
||||
|
||||
#include <signal.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
|
||||
|
@ -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 <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
@ -7,6 +7,7 @@ in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "SolarisCRT.h"
|
||||
#include "CRT.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
@ -6,6 +6,7 @@ in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "UnsupportedCRT.h"
|
||||
#include "CRT.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.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
|
||||
|
Loading…
Reference in New Issue
Block a user