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
This commit is contained in:
Alfonso Gregory 2023-07-07 10:39:23 -06:00 committed by Warner Losh
parent 1a7ac2bd24
commit cccdaf507e
18 changed files with 18 additions and 18 deletions

View File

@ -102,7 +102,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[])

View File

@ -121,7 +121,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[])

View File

@ -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,

View File

@ -82,7 +82,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)

View File

@ -70,7 +70,7 @@ int Fflag, fflag, qflag, rflag, rval, no_files, vflag;
fileargs_t *fa;
static void obsolete(char **);
static void usage(void);
static void usage(void) __dead2;
static const struct option long_opts[] =
{

View File

@ -66,7 +66,7 @@ struct entry {
static STAILQ_HEAD(, entry) head = STAILQ_HEAD_INITIALIZER(head);
static void add(int, const char *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View File

@ -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;

View File

@ -67,7 +67,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)

View File

@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View File

@ -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);

View File

@ -85,7 +85,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;

View File

@ -62,7 +62,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

View File

@ -58,7 +58,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);

View File

@ -70,7 +70,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;

View File

@ -49,7 +49,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

View File

@ -159,7 +159,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

View File

@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
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);

View File

@ -84,7 +84,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 *);