From nobody Fri Jul 07 16:51:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QyKD43Y9Gz4m3TR; Fri, 7 Jul 2023 16:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QyKD428vsz4NFN; Fri, 7 Jul 2023 16:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rhl9guMXmoiADVqv+O2qpuREfMfAjBhDU5e06mPhvWk=; b=pt5bZ95DPtvLO9jHR2Sl1FbBHNSJY23FPnNQ5TnqQJ0RDoa8otP5trxbY6Gz6S0kfs55jn WNPjA5fGK1/YDdrb4mxWiRewKo8w/RGUmwjJKM9FbhDGoJqdPFhU5RTwkn/0J82NjWN6PV UqUHzfGGJpRJfGO7VKxKfiaIx1BWvCGCssmoEjek2ZuIz4s8/YP+5a6HPDvzKxSncRNdLD dxe65lCUredd1mj8cSwxHLUoYUGZawWERM0DlTe5kzSkT1pGnzcOusJm8Ba6neN4sJKlQx 25pBVVV6LN1DYsG4bglKlN4RxeTZ2akKak++EFIp+I6fMekVxQpreU00AqvhMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rhl9guMXmoiADVqv+O2qpuREfMfAjBhDU5e06mPhvWk=; b=Y+KAgWG5Rwig+Cg1mRzx84Uc6nqXet1D9RZghqXJBjJz9dcQvKm0YSL8OzUeFfGGiXozQZ pyrpo3RbtI6Ldu/l5A0f3656fIrFRGKlewH3REL5ofLcroAAELdIDBdUtVUhTJ/Oj0qVpt fQqylJbizQTZsDDlLnbzn9SpwrYERD7xVOAgx5o39IofutVwjc/lR+hu9VFioHPe8ytfdw mcrktMZY8MeDYRCiuk7lZFochZsA3II0Y0elC1gdbqq3QL1FPev6Gl7D+8cr1oDy+NIm2R TP6bjJtUl4LKHCiUfq/MZJULm8ljVUJnCnxoNAn4XiBFiAUX1hkfsPIal70lAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688748676; a=rsa-sha256; cv=none; b=gk9j/Q6aIZJhMzdp0y93sJTkrMLQkcgxkiRREWeiz68LrvOGmuTnmEwqG9cij/5DvZoJg1 UxPSaqM07r6AkZQud2mnjO8IpHQgYhhzRyz3N0FnqZgKHFeTTEspdNLy1V2O0Kb6QgTeS/ 5TojHXXODnOZ+j2v2cy4cHHKOZdTIceZzISGv2s0EkKdRvFbW6DVT4oM315pNqzNpS1Fw+ hxPcu4AQi5NiAMd+U7jl4CQwkpP1ykKgHoWiGfAboJtb3nVQXvhfHx5yPR/hIAMoDTZAp/ NAbVsDYcxs7UVeczrq1mD07RXQgLTzb8cRe7SCt0rbPSS2zg5F/IGG5vjWI/jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QyKD41DS0zmgy; Fri, 7 Jul 2023 16:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 367GpG8K010783; Fri, 7 Jul 2023 16:51:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 367GpGKS010782; Fri, 7 Jul 2023 16:51:16 GMT (envelope-from git) Date: Fri, 7 Jul 2023 16:51:16 GMT Message-Id: <202307071651.367GpGKS010782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a9cce232a6b9 - main - Mark usage function as __dead2 in programs where it does not return List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9cce232a6b930d2d1932f1f20a86a84d9cc77cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9cce232a6b930d2d1932f1f20a86a84d9cc77cd commit a9cce232a6b930d2d1932f1f20a86a84d9cc77cd Author: Alfonso Gregory AuthorDate: 2023-07-07 16:39:23 +0000 Commit: Warner Losh CommitDate: 2023-07-07 16:45:18 +0000 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 --- usr.sbin/fdcontrol/fdcontrol.c | 2 +- usr.sbin/gstat/gstat.c | 2 +- usr.sbin/iostat/iostat.c | 5 ++--- usr.sbin/ip6addrctl/ip6addrctl.c | 2 +- usr.sbin/jail/jail.c | 2 +- usr.sbin/ndp/ndp.c | 2 +- usr.sbin/newsyslog/newsyslog.c | 2 +- usr.sbin/nfsdumpstate/nfsdumpstate.c | 2 +- usr.sbin/nfsrevoke/nfsrevoke.c | 2 +- usr.sbin/nscd/nscd.c | 2 +- usr.sbin/nvram/nvram.c | 2 +- 11 files changed, 12 insertions(+), 13 deletions(-) diff --git a/usr.sbin/fdcontrol/fdcontrol.c b/usr.sbin/fdcontrol/fdcontrol.c index 953076b5af93..d0ea0c705ae5 100644 --- a/usr.sbin/fdcontrol/fdcontrol.c +++ b/usr.sbin/fdcontrol/fdcontrol.c @@ -47,7 +47,7 @@ static int format, verbose, show = 1, showfmt; static char *fmtstring; static void showdev(enum fd_drivetype, const char *); -static void usage(void); +static void usage(void) __dead2; static void usage(void) diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c index cd44c740a3b4..b9f5d5eff449 100644 --- a/usr.sbin/gstat/gstat.c +++ b/usr.sbin/gstat/gstat.c @@ -66,7 +66,7 @@ static int flag_I = 1000000; printw(__VA_ARGS__); \ } while(0) -static void usage(void); +static void usage(void) __dead2; static const char* el_prompt(void) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 7c4dcf16e0a5..076f2acfe4e0 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -149,7 +149,7 @@ static int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; static int xflag = 0, zflag = 0; /* local function declarations */ -static void usage(void); +static void usage(void) __dead2; static void needhdr(int signo); static void needresize(int signo); static void needreturn(int signo); @@ -173,6 +173,7 @@ usage(void) fprintf(stderr, "usage: iostat [-CdhIKoTxz?] [-c count] [-M core]" " [-n devs] [-N system]\n" "\t [-t type,if,pass] [-w wait] [drives]\n"); + exit(1); } int @@ -261,8 +262,6 @@ main(int argc, char **argv) break; default: usage(); - exit(1); - break; } } diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c index 06d527dac2ce..12903ab25f66 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.c +++ b/usr.sbin/ip6addrctl/ip6addrctl.c @@ -62,7 +62,7 @@ struct policyqueue { TAILQ_HEAD(policyhead, policyqueue); static struct policyhead policyhead; -static void usage(void); +static void usage(void) __dead2; static void get_policy(void); static void dump_policy(void); static int mask2plen(struct sockaddr_in6 *); diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index a2c725d51b70..b8cccbbd625e 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -73,7 +73,7 @@ static void print_jail(FILE *fp, struct cfjail *j, int oldcl, int running); static void print_param(FILE *fp, const struct cfparam *p, int sep, int doname); static void show_jails(void); static void quoted_print(FILE *fp, char *str); -static void usage(void); +static void usage(void) __dead2; static struct permspec perm_sysctl[] = { { "security.jail.set_hostname_allowed", KP_ALLOW_SET_HOSTNAME, 0 }, diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 112fd099e3e0..becc04ec5f10 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -138,7 +138,7 @@ static int delete(char *); static int dump(struct sockaddr_in6 *, int); static struct in6_nbrinfo *getnbrinfo(struct in6_addr *, int, int); static int ndp_ether_aton(char *, u_char *); -static void usage(void); +static void usage(void) __dead2; static void ifinfo(char *, int, char **); static void rtrlist(void); static void plist(void); diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index 8f8bb54e9b46..5cd0f8b7a5d1 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -281,7 +281,7 @@ static struct conf_entry *init_entry(const char *fname, struct conf_entry *src_entry); static void parse_args(int argc, char **argv); static int parse_doption(const char *doption); -static void usage(void); +static void usage(void) __dead2; static int log_trim(const char *logname, const struct conf_entry *log_ent); static int age_old_log(const char *file); static void savelog(char *from, char *to); diff --git a/usr.sbin/nfsdumpstate/nfsdumpstate.c b/usr.sbin/nfsdumpstate/nfsdumpstate.c index c7e086655f79..16f6efab3033 100644 --- a/usr.sbin/nfsdumpstate/nfsdumpstate.c +++ b/usr.sbin/nfsdumpstate/nfsdumpstate.c @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static void dump_lockstate(char *); static void dump_openstate(void); -static void usage(void); +static void usage(void) __dead2; static char *open_flags(uint32_t); static char *deleg_flags(uint32_t); static char *lock_flags(uint32_t); diff --git a/usr.sbin/nfsrevoke/nfsrevoke.c b/usr.sbin/nfsrevoke/nfsrevoke.c index 85eb48bfa8fb..e9750afac722 100644 --- a/usr.sbin/nfsrevoke/nfsrevoke.c +++ b/usr.sbin/nfsrevoke/nfsrevoke.c @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) diff --git a/usr.sbin/nscd/nscd.c b/usr.sbin/nscd/nscd.c index 8a569a2dc9ab..14d0a6780bf4 100644 --- a/usr.sbin/nscd/nscd.c +++ b/usr.sbin/nscd/nscd.c @@ -85,7 +85,7 @@ static void process_socket_event(struct kevent *, struct runtime_env *, static void process_timer_event(struct kevent *, struct runtime_env *, struct configuration *); static void *processing_thread(void *); -static void usage(void); +static void usage(void) __dead2; void get_time_func(struct timeval *); diff --git a/usr.sbin/nvram/nvram.c b/usr.sbin/nvram/nvram.c index 52c1e809ae71..4a6a09ecd8f6 100644 --- a/usr.sbin/nvram/nvram.c +++ b/usr.sbin/nvram/nvram.c @@ -41,7 +41,7 @@ #define DEVICE_NAME (_PATH_DEV "powermac_nvram") -static void usage(void); +static void usage(void) __dead2; static int remove_var(uint8_t *, int, const char *); static int append_var(uint8_t *, int, const char *, const char *);