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 498a0a9c61
commit a1b6427a97
18 changed files with 18 additions and 18 deletions

View file

@ -56,7 +56,7 @@ static bool edit_file_features(Elf *, int, int, char *, bool);
static bool get_file_features(Elf *, int, int, uint32_t *, uint64_t *, bool);
static void print_features(void);
static bool print_file_features(Elf *, int, int, char *, bool);
static void usage(void);
static void usage(void) __dead2;
struct ControlFeatures {
const char *alias;

View file

@ -473,7 +473,7 @@ static void elf_print_got(Elf32_Ehdr *e, void *sh);
static void elf_print_hash(Elf32_Ehdr *e, void *sh);
static void elf_print_note(Elf32_Ehdr *e, void *sh);
static void usage(void);
static void usage(void) __dead2;
/*
* Helpers for ELF files with shnum or shstrndx values that don't fit in the

2
usr.bin/env/env.c vendored
View file

@ -62,7 +62,7 @@ extern char **environ;
int env_verbosity;
static void usage(void);
static void usage(void) __dead2;
/*
* Exit codes.

View file

@ -71,7 +71,7 @@ int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */
int regexp_flags = REG_BASIC; /* use the "basic" regexp by default*/
int exitstatus;
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -98,7 +98,7 @@ int invoker_root = 0;
static void loginlist(void);
static int option(int, char **);
static void usage(void);
static void usage(void) __dead2;
static void userlist(int, char **);
static int

View file

@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
void fold(int);
static int newpos(int, wint_t);
static void usage(void);
static void usage(void) __dead2;
static int bflag; /* Count bytes, not columns */
static int sflag; /* Split on word boundaries */

View file

@ -126,7 +126,7 @@ static int stable_collate_range_cmp(int, int);
static void do_order(void);
static void getargs(int, char **);
static void randomize(void);
static void usage(void);
static void usage(void) __dead2;
/*
* main:

View file

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

View file

@ -43,7 +43,7 @@ static void set(int, int);
static void standt(int);
static void movto(int, int);
static void sighndl(int);
static void usage(void);
static void usage(void) __dead2;
static void
sighndl(int signo)

View file

@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
static void head(FILE *, intmax_t);
static void head_bytes(FILE *, off_t);
static void obsolete(char *[]);
static void usage(void);
static void usage(void) __dead2;
static const struct option long_opts[] =
{

View file

@ -114,7 +114,7 @@ static void outoneline(INPUT *, LINE *);
static void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
static void slurp(INPUT *);
static wchar_t *towcs(const char *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -67,7 +67,7 @@ static int pid;
static void no_ktrace(int);
static void set_pid_clear(const char *, enum clear);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
#define USAGE \
"usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n"
static void usage(void);
static void usage(void) __dead2;
static struct nlist nl[] = {
{ .n_name = "_ktr_version" },

View file

@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
static void doalarm(u_int);
static void usage(void);
static void usage(void) __dead2;
/*
* leave [[+]hhmm]

View file

@ -257,7 +257,7 @@ static struct {
#define RCS_STRING "tfdscmlunbvpwko"
static rlim_t resource_num(int which, int ch, const char *str);
static void usage(void);
static void usage(void) __dead2;
static int getshelltype(void);
static void print_limit(rlim_t limit, unsigned divisor, const char *inf,
const char *pfx, const char *sfx, const char *which);

View file

@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$");
static void quit(int);
static void bye(int);
static void hi(int);
static void usage(void);
static void usage(void) __dead2;
static struct timeval timeout;
static struct timeval zerotime;

View file

@ -44,7 +44,7 @@ static int acquire_lock(const char *name, int flags);
static void cleanup(void);
static void killed(int sig);
static void timeout(int sig);
static void usage(void);
static void usage(void) __dead2;
static void wait_for_lock(const char *name);
static const char *lockname;

View file

@ -89,7 +89,7 @@ static int look(wchar_t *, unsigned char *, unsigned char *);
static wchar_t *prepkey(const char *, wchar_t);
static void print_from(wchar_t *, unsigned char *, unsigned char *);
static void usage(void);
static void usage(void) __dead2;
static struct option longopts[] = {
{ "alternative",no_argument, NULL, 'a' },