git: e97468063d6f - main - Mark usage function as __dead2 in programs where it does not return
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 07 Jul 2023 16:51:01 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e97468063d6f9274b885739a9bcb5be7fffc9598 commit e97468063d6f9274b885739a9bcb5be7fffc9598 Author: Alfonso Gregory <gfunni234@gmail.com> AuthorDate: 2023-07-07 16:39:23 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2023-07-07 16:45:17 +0000 Mark usage function as __dead2 in programs where it does not return In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735 --- bin/chflags/chflags.c | 2 +- bin/chio/chio.c | 2 +- bin/chmod/chmod.c | 2 +- bin/cp/extern.h | 2 +- bin/date/date.c | 4 ++-- bin/domainname/domainname.c | 2 +- bin/kill/kill.c | 2 +- bin/rmdir/rmdir.c | 2 +- bin/sleep/sleep.c | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index 55dedfce53f1..5c45085624a1 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); static volatile sig_atomic_t siginfo; -static void usage(void); +static void usage(void) __dead2; static void siginfo_handler(int sig __unused) diff --git a/bin/chio/chio.c b/bin/chio/chio.c index da9e4696588b..2a7ce706afd7 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include "defs.h" #include "pathnames.h" -static void usage(void); +static void usage(void) __dead2; static void cleanup(void); static u_int16_t parse_element_type(char *); static u_int16_t parse_element_unit(char *); diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c index e8657af0d97b..cd02c4fa810d 100644 --- a/bin/chmod/chmod.c +++ b/bin/chmod/chmod.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); static volatile sig_atomic_t siginfo; -static void usage(void); +static void usage(void) __dead2; static int may_have_nfs4acl(const FTSENT *ent, int hflag); static void diff --git a/bin/cp/extern.h b/bin/cp/extern.h index 65360ccaf6c1..f42315f07390 100644 --- a/bin/cp/extern.h +++ b/bin/cp/extern.h @@ -50,5 +50,5 @@ int copy_special(struct stat *, int); int setfile(struct stat *, int); int preserve_dir_acls(struct stat *, char *, char *); int preserve_fd_acls(int, int); -void usage(void); +void usage(void) __dead2; __END_DECLS diff --git a/bin/date/date.c b/bin/date/date.c index c1fb496ce7ee..b7841030864c 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -68,12 +68,12 @@ __FBSDID("$FreeBSD$"); static time_t tval; static void badformat(void); -static void iso8601_usage(const char *); +static void iso8601_usage(const char *) __dead2; static void multipleformats(void); static void printdate(const char *); static void printisodate(struct tm *); static void setthetime(const char *, const char *, int); -static void usage(void); +static void usage(void) __dead2; static const struct iso8601_fmt { const char *refname; diff --git a/bin/domainname/domainname.c b/bin/domainname/domainname.c index cd14778221c3..cb42990315b6 100644 --- a/bin/domainname/domainname.c +++ b/bin/domainname/domainname.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/bin/kill/kill.c b/bin/kill/kill.c index 201ab9aaf3e9..4ff7a8b19f9f 100644 --- a/bin/kill/kill.c +++ b/bin/kill/kill.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); static void nosig(const char *); static void printsignals(FILE *); static int signame_to_signum(const char *); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index 22f1141e14ec..6f1545e40217 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> static int rm_path(char *); -static void usage(void); +static void usage(void) __dead2; static int pflag; static int vflag; diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index 55e0aba9871a..5c9e7b17b9d9 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <time.h> -static void usage(void); +static void usage(void) __dead2; static volatile sig_atomic_t report_requested; static void