From: Christian Göttsche Date: Thu, 26 Jan 2023 21:08:43 +0000 (+0100) Subject: Declare usage and failure handler noreturn X-Git-Tag: 4.15.0-rc1~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35edae5892eabfefa0bb485a7a431bd0c938395a;p=thirdparty%2Fshadow.git Declare usage and failure handler noreturn Assist static analyzers in understanding final code paths. --- diff --git a/src/chgpasswd.c b/src/chgpasswd.c index 7b773e2ff..d7cdd76a9 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -62,7 +62,7 @@ static bool sgr_locked = false; static bool gr_locked = false; /* local function prototypes */ -static void fail_exit (int code); +NORETURN static void fail_exit (int code); NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void check_flags (void); diff --git a/src/groupmems.c b/src/groupmems.c index 1ac937ea1..63a1601cc 100644 --- a/src/groupmems.c +++ b/src/groupmems.c @@ -71,7 +71,7 @@ static void display_members (const char *const *members); NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void check_perms (void); -static void fail_exit (int code); +NORETURN static void fail_exit (int code); #define isroot() (getuid () == 0) static char *whoami (void) diff --git a/src/su.c b/src/su.c index b03344130..d8a208572 100644 --- a/src/su.c +++ b/src/su.c @@ -433,6 +433,7 @@ static void prepare_pam_close_session (void) /* * usage - print command line syntax and exit */ +NORETURN static void usage (int status) { (void) diff --git a/src/useradd.c b/src/useradd.c index a69099277..11d0bc9cb 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -205,13 +205,13 @@ static bool home_added = false; #define DLOG_INIT "LOG_INIT=" /* local function prototypes */ -static void fail_exit (int); +NORETURN static void fail_exit (int); static void get_defaults (void); static void show_defaults (void); static int set_defaults (void); static int get_groups (char *); static struct group * get_local_group (char * grp_name); -static void usage (int status); +NORETURN static void usage (int status); static void new_pwent (struct passwd *); static long scale_age (long);