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 69c0fb2a7a
commit 65f3be9110
12 changed files with 12 additions and 12 deletions

View File

@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
#define REPORT_PERIOD (30*60)
static void fake(int);
static void usage(void);
static void usage(void) __dead2;
static void
fake(int unused __unused)

View File

@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ioctl.h>
static void usage(void);
static void usage(void) __dead2;
static void
usage(void)

View File

@ -258,7 +258,7 @@ static int decimal(const char *str, int *num, int deflt, uint32_t maxval);
static int read_config(char *config_file);
static void reset_boot(void);
static int sanitize_partition(struct dos_partition *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View File

@ -50,7 +50,7 @@
#include "ldconfig.h"
#include "rtld_paths.h"
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char **argv)

View File

@ -60,7 +60,7 @@ static struct md_ioctl mdio;
static enum {UNSET, ATTACH, DETACH, RESIZE, LIST} action = UNSET;
static int nflag;
static void usage(void);
static void usage(void) __dead2;
static void md_set_file(const char *);
static int md_find(const char *, const char *);
static int md_query(const char *, const int, const char *);

View File

@ -124,7 +124,7 @@ static char *disktype;
static void getfssize(intmax_t *, const char *p, intmax_t, intmax_t);
static struct disklabel *getdisklabel(void);
static void usage(void);
static void usage(void) __dead2;
static int expand_number_int(const char *buf, int *num);
ufs2_daddr_t part_ofs; /* partition offset in blocks, used with files */

View File

@ -51,7 +51,7 @@ static const char rcsid[] =
static u_int argtou(const char *, u_int, u_int, const char *);
static off_t argtooff(const char *, const char *);
static void usage(void);
static void usage(void) __dead2;
static time_t
get_tstamp(const char *b)

View File

@ -89,7 +89,7 @@ static struct ifreq ifrq;
int net; /* socket descriptor */
int tun; /* tunnel descriptor */
static void usage(void);
static void usage(void) __dead2;
static int
Set_address(char *addr, struct sockaddr_in *sin)

View File

@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include <utmpx.h>
static void usage(void);
static void usage(void) __dead2;
static u_int get_pageins(void);
static int dohalt;

View File

@ -131,7 +131,7 @@ static void query_loop(char *argv[], int) __attribute((__noreturn__));
static int getnet(char *, struct netinfo *);
static u_int std_mask(u_int);
static int parse_quote(char **, const char *, char *, char *, int);
static void usage(void);
static void usage(void) __dead2;
int

View File

@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
static void usage(void);
static void usage(void) __dead2;
static const char *swap_on_off(const char *, int, char *);
static const char *swap_on_off_gbde(const char *, int);
static const char *swap_on_off_geli(const char *, char *, int);

View File

@ -80,7 +80,7 @@ static char clrbuf[MAXBSIZE];
static struct uufsd disk;
#define sblock disk.d_fs
static void usage(void);
static void usage(void) __dead2;
static void printfs(void);
static int journal_alloc(int64_t size);
static void journal_clear(void);