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 a1b6427a97
commit 1a7ac2bd24
17 changed files with 17 additions and 17 deletions

View file

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

View file

@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \
S_IROTH | S_IWOTH
static void usage(void);
static void usage(void) __dead2;
static int f_mode;

View file

@ -50,7 +50,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
static void usage(void);
static void usage(void) __dead2;
static const struct option long_opts[] = {
{"directory", no_argument, NULL, 'd'},

View file

@ -99,7 +99,7 @@ static const struct mkuz_format uzip_fmts[] = {
};
static struct mkuz_blk *readblock(int, u_int32_t);
static void usage(void);
static void usage(void) __dead2;
static void cleanup(void);
static char *cleanfile = NULL;

View file

@ -180,7 +180,7 @@ static const struct commands {
static const char *getblksiz(int);
static void printreg(const char *, u_int, const char *);
static void status(struct mtget *);
static void usage(void);
static void usage(void) __dead2;
const char *get_driver_state_str(int dsreg);
static void st_status (struct mtget *);
static int mt_locate(int argc, char **argv, int mtfd, const char *tape);

View file

@ -192,7 +192,7 @@ static struct protox *protoprotox[] = {
NULL };
static void printproto(struct protox *, const char *, bool *);
static void usage(void);
static void usage(void) __dead2;
static struct protox *name2protox(const char *);
static struct protox *knownname(const char *);

View file

@ -90,7 +90,7 @@ static char PKFILE[] = "/etc/publickey";
static const char *err_string(int);
#endif /* YP */
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -109,7 +109,7 @@ static int extra_output = 0;
static void intpr(int, int);
static void printhdr(int, int, int);
static void usage(void);
static void usage(void) __dead2;
static char *sperc1(int, int);
static char *sperc2(int, int);
static void exp_intpr(int, int, int);

View file

@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
static void dofile(void);
static void usage(void);
static void usage(void) __dead2;
#define FILENAME "nohup.out"
/*

View file

@ -65,7 +65,7 @@ static int delimcnt;
static int parallel(char **);
static int sequential(char **);
static int tr(wchar_t *);
static void usage(void);
static void usage(void) __dead2;
static wchar_t tab[] = L"\t";

View file

@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include <locale.h>
#include <sys/errno.h>
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char **argv)

View file

@ -86,7 +86,7 @@ struct quotause {
static char *timeprt(int64_t seconds);
static struct quotause *getprivs(long id, int quotatype);
static void usage(void);
static void usage(void) __dead2;
static int showuid(u_long uid);
static int showgid(u_long gid);
static int showusrname(char *name);

View file

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

View file

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

View file

@ -64,7 +64,7 @@ static void clnt_output(const char *, const char *, int, const char * );
static char *generate_guard(const char *);
static void c_initialize(void);
static void usage(void);
static void usage(void) __dead2;
static void options_usage(void);
static int do_registers(int, const char **);
static int parseargs(int, const char **, struct commandline *);

View file

@ -71,7 +71,7 @@ static char *mbuf;
static char notty[] = "no tty";
static void makemsg(const char *);
static void usage(void);
static void usage(void) __dead2;
/* ARGSUSED */
int

View file

@ -83,7 +83,7 @@ static struct myutmp {
static time_t now;
static int aflg;
static void usage(void);
static void usage(void) __dead2;
static int utmpcmp(const void *, const void *);
int