ps: trade cumbersome GNU attributes with less wordy alternatives

This commit is contained in:
Jim Warner 2012-01-02 01:26:45 -06:00 committed by Craig Small
parent fb11e1fe0a
commit fe20653a4e
3 changed files with 7 additions and 5 deletions

View File

@ -338,7 +338,7 @@ extern int want_this_proc(proc_t *buf);
extern const char *select_bits_setup(void); extern const char *select_bits_setup(void);
/* help.c */ /* help.c */
extern void __attribute__ ((__noreturn__)) usage(FILE * out, int section); extern void usage(FILE * out, int section) NORETURN;
/* global.c */ /* global.c */
extern void self_info(void); extern void self_info(void);

View File

@ -15,8 +15,8 @@
#include "common.h" #include "common.h"
void __attribute__ ((__noreturn__)) usage(FILE * out, int section) void usage(FILE * out, int section) NORETURN;
{ void usage(FILE * out, int section){
fputs(USAGE_HEADER, out); fputs(USAGE_HEADER, out);
fprintf(out, fprintf(out,
_(" %s [options]\n"), program_invocation_short_name); _(" %s [options]\n"), program_invocation_short_name);

View File

@ -30,7 +30,8 @@ static void debug_stop(char **args){
} }
/***********/ /***********/
static void stack_trace_sigchld(int signum __attribute__ ((__unused__))){ static void stack_trace_sigchld(int signum){
(void)signum;
stack_trace_done = 1; stack_trace_done = 1;
} }
@ -156,7 +157,8 @@ void debug(int method, char *prog_name){
} }
/************/ /************/
static void stack_trace_sigsegv(int signum __attribute__ ((__unused__))){ static void stack_trace_sigsegv(int signum){
(void)signum;
debug(STACK_TRACE, stored_prog_name); debug(STACK_TRACE, stored_prog_name);
} }