diff --git a/src/chage.c b/src/chage.c index 01570d72..5954ebe8 100644 --- a/src/chage.c +++ b/src/chage.c @@ -66,7 +66,7 @@ static long inactdays; static long expdate; /* local function prototypes */ -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static int new_fields (void); static void print_date (time_t date); static void list_fields (void); @@ -75,12 +75,14 @@ static void check_flags (int argc, int opt_index); static void check_perms (void); static void open_files (bool readonly); static void close_files (void); -static /*@noreturn@*/void fail_exit (int code); +NORETURN static void fail_exit (int code); /* * fail_exit - do some cleanup and exit with the given error code */ -static /*@noreturn@*/void fail_exit (int code) +NORETURN +static void +fail_exit (int code) { if (spw_locked) { if (spw_unlock () == 0) { @@ -112,7 +114,9 @@ static /*@noreturn@*/void fail_exit (int code) /* * usage - print command line syntax and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/chfn.c b/src/chfn.c index 246e2e82..d56b329e 100644 --- a/src/chfn.c +++ b/src/chfn.c @@ -55,7 +55,7 @@ static bool pw_locked = false; /* local function prototypes */ static void fail_exit (int code); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static bool may_change_field (int); static void new_fields (void); static char *copy_field (char *, char *, char *); @@ -86,7 +86,9 @@ static void fail_exit (int code) /* * usage - print command line syntax and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/chgpasswd.c b/src/chgpasswd.c index f6c92293..b750994e 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -63,7 +63,7 @@ static bool gr_locked = false; /* local function prototypes */ static void fail_exit (int code); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void check_flags (void); static void check_perms (void); @@ -99,7 +99,9 @@ static void fail_exit (int code) /* * usage - display usage message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/chpasswd.c b/src/chpasswd.c index e3188a76..5c1c6c26 100644 --- a/src/chpasswd.c +++ b/src/chpasswd.c @@ -60,7 +60,7 @@ static bool spw_locked = false; /* local function prototypes */ static void fail_exit (int code); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void check_flags (void); static void check_perms (void); @@ -94,7 +94,9 @@ static void fail_exit (int code) /* * usage - display usage message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/chsh.c b/src/chsh.c index fe0f4609..64f53392 100644 --- a/src/chsh.c +++ b/src/chsh.c @@ -53,8 +53,8 @@ static bool pw_locked = false; /* external identifiers */ /* local function prototypes */ -static /*@noreturn@*/void fail_exit (int code); -static /*@noreturn@*/void usage (int status); +NORETURN static void fail_exit (int code); +NORETURN static void usage (int status); static void new_fields (void); static bool shell_is_listed (const char *); static bool is_restricted_shell (const char *); @@ -65,7 +65,9 @@ static void update_shell (const char *user, char *loginsh); /* * fail_exit - do some cleanup and exit with the given error code */ -static /*@noreturn@*/void fail_exit (int code) +NORETURN +static void +fail_exit (int code) { if (pw_locked) { if (pw_unlock () == 0) { @@ -83,7 +85,9 @@ static /*@noreturn@*/void fail_exit (int code) /* * usage - print command line syntax and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/expiry.c b/src/expiry.c index 70e6c20e..b980b656 100644 --- a/src/expiry.c +++ b/src/expiry.c @@ -28,7 +28,7 @@ static bool cflg = false; /* local function prototypes */ static void catch_signals (unused int sig); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void process_flags (int argc, char **argv); /* @@ -42,7 +42,9 @@ static void catch_signals (unused int sig) /* * usage - print syntax message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/faillog.c b/src/faillog.c index 72b8a956..0f52e0f7 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -26,7 +26,7 @@ #include "shadowlog.h" /* local function prototypes */ -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void print_one (/*@null@*/const struct passwd *pw, bool force); static void set_locktime (long locktime); static bool set_locktime_one (uid_t uid, long locktime); @@ -59,7 +59,9 @@ static struct stat statbuf; /* fstat buffer for file size */ #define NOW time(NULL) -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/groupadd.c b/src/groupadd.c index 66ccb53e..9a6df273 100644 --- a/src/groupadd.c +++ b/src/groupadd.c @@ -70,7 +70,7 @@ static bool is_shadow_grp; #endif /* local function prototypes */ -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void new_grent (struct group *grent); #ifdef SHADOWGRP @@ -87,7 +87,9 @@ static void check_perms (void); /* * usage - display usage message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/groupdel.c b/src/groupdel.c index a9b15dca..65fc04e2 100644 --- a/src/groupdel.c +++ b/src/groupdel.c @@ -58,7 +58,7 @@ static bool is_shadow_grp; #define E_GRP_UPDATE 10 /* can't update group file */ /* local function prototypes */ -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void grp_update (void); static void close_files (void); static void open_files (void); @@ -68,7 +68,9 @@ static void process_flags (int argc, char **argv); /* * usage - display usage message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/groupmems.c b/src/groupmems.c index a0e3266b..a962c055 100644 --- a/src/groupmems.c +++ b/src/groupmems.c @@ -66,7 +66,7 @@ static void remove_user (const char *user, const struct group *grp); static void purge_members (const struct group *grp); static void display_members (const char *const *members); -static /*@noreturn@*/void usage (int status); +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); @@ -339,7 +339,9 @@ static void display_members (const char *const *members) } } -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (EXIT_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/grpck.c b/src/grpck.c index 881fb4de..ec092b2c 100644 --- a/src/grpck.c +++ b/src/grpck.c @@ -62,7 +62,7 @@ static bool silence_warnings = false; /* local function prototypes */ static void fail_exit (int status); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void delete_member (char **, const char *); static void process_flags (int argc, char **argv); static void open_files (void); @@ -114,7 +114,9 @@ static void fail_exit (int status) /* * usage - print syntax message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; #ifdef SHADOWGRP diff --git a/src/lastlog.c b/src/lastlog.c index 3338d6bd..6c2a34d3 100644 --- a/src/lastlog.c +++ b/src/lastlog.c @@ -58,7 +58,9 @@ static bool Sflg = false; /* set record for user */ #define NOW time(NULL) -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, diff --git a/src/passwd.c b/src/passwd.c index c729a14a..1aebdc37 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -104,7 +104,7 @@ static bool do_update_pwd = false; */ /* local function prototypes */ -static /*@noreturn@*/void usage (int); +NORETURN static void usage (int); #ifndef USE_PAM static bool reuse (const char *, const struct passwd *); @@ -114,8 +114,8 @@ static void check_password (const struct passwd *, const struct spwd *); #endif /* !USE_PAM */ static /*@observer@*/const char *pw_status (const char *); static void print_status (const struct passwd *); -static /*@noreturn@*/void fail_exit (int); -static /*@noreturn@*/void oom (void); +NORETURN static void fail_exit (int); +NORETURN static void oom (void); static char *update_crypt_pw (char *); static void update_noshadow (void); @@ -124,7 +124,9 @@ static void update_shadow (void); /* * usage - print command usage and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, @@ -466,7 +468,9 @@ static void print_status (const struct passwd *pw) } -static /*@noreturn@*/void fail_exit (int status) +NORETURN +static void +fail_exit (int status) { if (pw_locked) { if (pw_unlock () == 0) { @@ -487,7 +491,9 @@ static /*@noreturn@*/void fail_exit (int status) exit (status); } -static /*@noreturn@*/void oom (void) +NORETURN +static void +oom (void) { (void) fprintf (stderr, _("%s: out of memory\n"), Prog); fail_exit (E_FAILURE); diff --git a/src/pwck.c b/src/pwck.c index 83aaaca9..8e449fc3 100644 --- a/src/pwck.c +++ b/src/pwck.c @@ -66,7 +66,7 @@ static bool quiet = false; /* don't report warnings, only errors */ /* local function prototypes */ static void fail_exit (int code); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void open_files (void); static void close_files (bool changed); @@ -109,7 +109,9 @@ static void fail_exit (int code) /* * usage - print syntax message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; #ifdef WITH_TCB diff --git a/src/su.c b/src/su.c index 4fe86fee..35995c64 100644 --- a/src/su.c +++ b/src/su.c @@ -111,7 +111,7 @@ static void die (int); static bool iswheel (const char *); #endif /* !USE_PAM */ static bool restricted_shell (const char *shellname); -static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root); +NORETURN static void su_failure (const char *tty, bool su_to_root); static /*@only@*/struct passwd * check_perms (void); #ifdef USE_PAM static void check_perms_pam (const struct passwd *pw); @@ -185,7 +185,9 @@ static bool restricted_shell (const char *shellname) return true; } -static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root) +NORETURN +static void +su_failure (const char *tty, bool su_to_root) { sulog (tty, false, caller_name, name); /* log failed attempt */ if (getdef_bool ("SYSLOG_SU_ENAB")) { diff --git a/src/usermod.c b/src/usermod.c index 1c65a934..7a357c4f 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -163,10 +163,10 @@ static bool sub_gid_locked = false; /* local function prototypes */ static int get_groups (char *); -static /*@noreturn@*/void usage (int status); +NORETURN static void usage (int status); static void new_pwent (struct passwd *); static void new_spent (struct spwd *); -static /*@noreturn@*/void fail_exit (int); +NORETURN static void fail_exit (int); static void update_group (void); #ifdef SHADOWGRP @@ -359,7 +359,9 @@ static int prepend_range(const char *str, struct ulong_range_list_entry **head) /* * usage - display usage message and exit */ -static /*@noreturn@*/void usage (int status) +NORETURN +static void +usage (int status) { FILE *usageout = (E_SUCCESS != status) ? stderr : stdout; (void) fprintf (usageout, @@ -627,7 +629,9 @@ static void new_spent (struct spwd *spent) /* * fail_exit - exit with an error code after unlocking files */ -static /*@noreturn@*/void fail_exit (int code) +NORETURN +static void +fail_exit (int code) { if (gr_locked) { if (gr_unlock () == 0) {