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 5c3b5af6a2
commit 498a0a9c61
13 changed files with 13 additions and 13 deletions

View file

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

View file

@ -1026,7 +1026,7 @@ static char print[DWIDTH];
static int debug, i, j, linen, max, nchars, pc, term, trace, x, y;
static int width = DWIDTH; /* -w option: scrunch letters to 80 columns */
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

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

@ -70,7 +70,7 @@ extern int main_base64_encode(const char *, const char *);
static void encode(void);
static void base64_encode(void);
static int arg_to_col(const char *);
static void usage(void);
static void usage(void) __dead2;
static FILE *output;
static int mode;

View file

@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
static int elftype(const char *);
static const char *iselftype(int);
static void printelftypes(void);
static void usage(void);
static void usage(void) __dead2;
struct ELFtypes {
const char *str;

View file

@ -50,7 +50,7 @@ static u_int cargs, nargs;
static void addarg(const char *);
static void addlib(const char *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -145,7 +145,7 @@ static int say_next, hup_next;
void *dup_mem(void *b, size_t c);
void *copy_of(char *s);
static void usage(void);
static void usage(void) __dead2;
void chat_logf(const char *fmt, ...);
void fatal(int code, const char *fmt, ...);
SIGTYPE sigalrm(int signo);

View file

@ -74,7 +74,7 @@ static char PKFILE[] = "/etc/publickey";
#endif /* YP */
static char ROOTKEY[] = "/etc/.rootkey";
static void usage(void);
static void usage(void) __dead2;
extern int yp_update(char *, char *, int, char *, size_t, char *, size_t);
int

View file

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

View file

@ -86,7 +86,7 @@ siginfo(int signo)
}
#endif
static void usage(void);
static void usage(void) __dead2;
static bool
parse_iskipspec(char *spec, off_t *skip1, off_t *skip2)

View file

@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#define TAB 8
void check(FILE *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char *argv[])

View file

@ -69,7 +69,7 @@ static id_t id;
static cpulevel_t level;
static cpuwhich_t which;
static void usage(void);
static void usage(void) __dead2;
struct numa_policy {
const char *name;

View file

@ -87,7 +87,7 @@ char lbuf[LINE_MAX];
void init(void);
void find_entries(char *);
static void usage(void);
static void usage(void) __dead2;
int
main(int argc, char **argv)