git: 9dcbb9e681d7 - stable/13 - Mark usage function as __dead2 in programs where it does not return
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 14 Sep 2023 15:00:33 UTC
The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9dcbb9e681d70bbe6bab093ddea60bd8687f2c4c commit 9dcbb9e681d70bbe6bab093ddea60bd8687f2c4c Author: Alfonso Gregory <gfunni234@gmail.com> AuthorDate: 2023-07-07 16:39:23 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2023-09-14 14:59:52 +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 (cherry picked from commit cccdaf507eee8fb34494b4624eb85bb951e323c8) --- usr.bin/script/script.c | 2 +- usr.bin/sed/main.c | 2 +- usr.bin/showmount/showmount.c | 2 +- usr.bin/split/split.c | 2 +- usr.bin/tail/tail.c | 2 +- usr.bin/tee/tee.c | 2 +- usr.bin/time/time.c | 2 +- usr.bin/tr/tr.c | 2 +- usr.bin/tty/tty.c | 2 +- usr.bin/ul/ul.c | 2 +- usr.bin/uname/uname.c | 2 +- usr.bin/unexpand/unexpand.c | 2 +- usr.bin/usbhidctl/usbhid.c | 2 +- usr.bin/wall/wall.c | 2 +- usr.bin/what/what.c | 2 +- usr.bin/whois/whois.c | 2 +- usr.bin/write/write.c | 2 +- usr.bin/xstr/xstr.c | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 7ed54674c03d..b3a1869fcb42 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -101,7 +101,7 @@ static void finish(void); static void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int); static void playback(FILE *) __dead2; -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index 0b764a7dca21..efa28b5e7239 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -119,7 +119,7 @@ u_long linenum; static void add_compunit(enum e_cut, char *); static void add_file(char *); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c index fbd1c9bbbe3c..d2b9f46792ba 100644 --- a/usr.bin/showmount/showmount.c +++ b/usr.bin/showmount/showmount.c @@ -97,7 +97,7 @@ static struct exportslist *exportslist; static int type = 0; void print_dump(struct mountlist *); -static void usage(void); +static void usage(void) __dead2; int xdr_mntdump(XDR *, struct mountlist **); int xdr_exportslist(XDR *, struct exportslist **); int tcp_callrpc(const char *host, int prognum, int versnum, int procnum, diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index eeb7d663ecb1..b5a457ab6ecd 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -80,7 +80,7 @@ static void newfile(void); static void split1(void); static void split2(void); static void split3(void); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index 9e63353f9b40..5babd89135ca 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -65,7 +65,7 @@ int Fflag, fflag, qflag, rflag, rval, no_files; fileargs_t *fa; static void obsolete(char **); -static void usage(void); +static void usage(void) __dead2; static const struct option long_opts[] = { diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c index b55aa84d2f63..63f2ed5ca863 100644 --- a/usr.bin/tee/tee.c +++ b/usr.bin/tee/tee.c @@ -65,7 +65,7 @@ typedef struct _list { static LIST *head; static void add(int, const char *); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index 9121b1f14408..64063212170d 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -66,7 +66,7 @@ static void humantime(FILE *, long, long); static void showtime(FILE *, struct timespec *, struct timespec *, struct rusage *); static void siginfo(int); -static void usage(void); +static void usage(void) __dead2; static sig_atomic_t siginfo_recvd; static char decimal_point; diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 4bd52fae1a08..75638d6b3bc6 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -64,7 +64,7 @@ static STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; static STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; static struct cset *setup(char *, STR *, int, int); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c index ac3249d35ff2..945e62cc6f3a 100644 --- a/usr.bin/tty/tty.c +++ b/usr.bin/tty/tty.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/6/93"; #include <stdlib.h> #include <unistd.h> -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c index 14b1d87905d2..07a796ffd55b 100644 --- a/usr.bin/ul/ul.c +++ b/usr.bin/ul/ul.c @@ -89,7 +89,7 @@ static int halfpos; static int upln; static int iflag; -static void usage(void); +static void usage(void) __dead2; static void setnewmode(int); static void initcap(void); static void reverse(void); diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c index 981d08a7a7c0..fc1f34a3e3c6 100644 --- a/usr.bin/uname/uname.c +++ b/usr.bin/uname/uname.c @@ -82,7 +82,7 @@ static void native_uservers(void); static void native_buildid(void); static void print_uname(u_int); static void setup_get(void); -static void usage(void); +static void usage(void) __dead2; static char *buildid, *ident, *platform, *hostname, *arch, *release, *sysname, *version, *kernvers, *uservers; diff --git a/usr.bin/unexpand/unexpand.c b/usr.bin/unexpand/unexpand.c index 116c4e02af4c..6dcfc497d6e8 100644 --- a/usr.bin/unexpand/unexpand.c +++ b/usr.bin/unexpand/unexpand.c @@ -59,7 +59,7 @@ static int nstops; static int tabstops[100]; static void getstops(const char *); -static void usage(void); +static void usage(void) __dead2; static int tabify(const char *); int diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c index 5226958da3eb..dbb05030e908 100644 --- a/usr.bin/usbhidctl/usbhid.c +++ b/usr.bin/usbhidctl/usbhid.c @@ -57,7 +57,7 @@ static int hexdump = 0; static int wflag = 0; static int zflag = 0; -static void usage(void); +static void usage(void) __dead2; static void dumpitem(const char *label, struct hid_item *h); static void dumpitems(report_desc_t r); static void prdata(u_char *buf, struct hid_item *h); diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 992bc9f77b22..335f83623576 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -67,7 +67,7 @@ static const char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93"; #include "ttymsg.h" static void makemsg(char *); -static void usage(void); +static void usage(void) __dead2; static struct wallgroup { struct wallgroup *next; diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c index 5cd6a85f35bf..1829a6b055b2 100644 --- a/usr.bin/what/what.c +++ b/usr.bin/what/what.c @@ -46,7 +46,7 @@ static const char sccsid[] = "@(#)what.c 8.1 (Berkeley) 6/6/93"; #include <stdlib.h> #include <unistd.h> -static void usage(void); +static void usage(void) __dead2; static bool search(bool, bool, FILE *); int diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index 9af40a6b998c..13b9c7d13aef 100644 --- a/usr.bin/whois/whois.c +++ b/usr.bin/whois/whois.c @@ -157,7 +157,7 @@ static const char *port = DEFAULT_PORT; static const char *choose_server(char *); static struct addrinfo *gethostinfo(const char *, const char *, int); static void s_asprintf(char **ret, const char *format, ...) __printflike(2, 3); -static void usage(void); +static void usage(void) __dead2; static void whois(const char *, const char *, const char *, int); int diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index c0973c1ca58c..b5f484dcdf27 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -69,7 +69,7 @@ static char sccsid[] = "@(#)write.c 8.1 (Berkeley) 6/6/93"; void done(int); void do_write(int, char *, char *, const char *); -static void usage(void); +static void usage(void) __dead2; int term_chk(int, char *, int *, time_t *, int); void wr_fputs(wchar_t *s); void search_utmp(int, char *, char *, char *, uid_t); diff --git a/usr.bin/xstr/xstr.c b/usr.bin/xstr/xstr.c index b1a5bf58ae01..880fc1583542 100644 --- a/usr.bin/xstr/xstr.c +++ b/usr.bin/xstr/xstr.c @@ -81,7 +81,7 @@ static int xgetc(FILE *); static off_t hashit(char *, int); static off_t yankstr(char **); -static void usage(void); +static void usage(void) __dead2; static void flushsh(void); static void found(int, off_t, char *);