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 cccdaf507e
commit 72e1ea2f13
13 changed files with 14 additions and 14 deletions

View file

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

@ -90,7 +90,7 @@ static void nuke_entries(uint32_t ifindex, struct in_addr addr);
static int print_entries(uint32_t ifindex, struct in_addr addr);
static int delete(char *host);
static void usage(void);
static void usage(void) __dead2;
static int set(int argc, char **argv);
static int get(char *host);
static int file(char *name);

View file

@ -48,7 +48,7 @@
static int do_bthid_command(bdaddr_p bdaddr, int argc, char **argv);
static struct bthid_command * find_bthid_command(char const *command, struct bthid_command *category);
static void print_bthid_command(struct bthid_command *category);
static void usage(void);
static void usage(void) __dead2;
int32_t hid_sdp_query(bdaddr_t const *local, bdaddr_t const *remote, int32_t *error);

View file

@ -72,9 +72,9 @@ static const struct {
{ "GN", SDP_SERVICE_CLASS_GN, "Group Network" },
};
static void main_exit(int);
static void main_exit(int) __dead2;
static void main_detach(void);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -107,7 +107,7 @@ static int boot0bs(const u_int8_t *);
static void stropt(const char *, int *, int *);
static int argtoi(const char *, int, int, int);
static int set_bell(u_int8_t *, int, int);
static void usage(void);
static void usage(void) __dead2;
static unsigned vol_id[5]; /* 4 plus 1 for flag */

View file

@ -39,7 +39,7 @@ const char *bootpfile = "/etc/bootparams";
static struct sockaddr_in my_addr;
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char **argv)

View file

@ -30,7 +30,7 @@ static char cln[MAX_MACHINE_NAME+1];
static char dmn[MAX_MACHINE_NAME+1];
static char path[MAX_PATH_LEN+1];
static void usage(void);
static void usage(void) __dead2;
int printgetfile(bp_getfile_res *);
int printwhoami(bp_whoami_res *);

View file

@ -127,7 +127,7 @@ static unsigned int optfmt(const char *);
static uint32_t optaddr(const char *);
static int optpage(const char *, int);
static void Warn(const char *, const char *, ...);
static void usage(void);
static void usage(void) __dead2;
/*
* A link editor for BTX clients.

View file

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

@ -86,7 +86,7 @@ static const char *stripath(const char *path);
static int distfile(const char *path);
static int disttype(const char *name);
static int fail(const char *path, const char *msg);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
static const char *pname = "crunchide";
static void usage(void);
static void usage(void) __dead2;
static void add_to_keep_list(char *symbol);
static void add_file_to_keep_list(char *filename);

View file

@ -110,7 +110,7 @@ struct quotause *getprivs(long, int, char *);
void putprivs(long, struct quotause *);
int readprivs(struct quotause *, char *);
int readtimes(struct quotause *, char *);
static void usage(void);
static void usage(void) __dead2;
int writetimes(struct quotause *, int, int);
int writeprivs(struct quotause *, int, char *, int);

View file

@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
static void efi_table_print_esrt(const void *data);
static void efi_table_print_prop(const void *data);
static void usage(void);
static void usage(void) __dead2;
struct efi_table_op {
char name[TABLE_MAX_LEN];