From nobody Fri Jul 07 16:51:17 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 4QyKD53n4kz4m3TX; Fri, 7 Jul 2023 16:51:17 +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 4QyKD53GNFz4N7G; Fri, 7 Jul 2023 16:51:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748677; 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=QIPnijE6N6VvPZIFXdaD7cA5kFZsGhnQmO5oFJ3T+ss=; b=dJoRUoqol4bfVN8V7wv8WsVrV372BjAk7XYxL79cDgpEcr/pargl+26D+0T8vwFrsJkZIY Wv7pS6zlmMhdzKW1xGqnoH65n/Z2Wx6mtq9dGNdJTeIifYKdGlaOf14zLz7IfijAQh0TG5 0HCKh19APqUme5Tk9zsaHbIq1wCFUJE3T20fhD5KiYogjA6M13Uho41k9lbYlsYAAkxNlF b3PonlZG8U6gSM1ekJ0n83fxyFCJDSIRxXkOCIeyTTI93WyKMZxrPTZ7sYhD4Y7vSuskl6 cJTWm8tRnKVU01avSVSPWqC8CxveC4E7CUHaDYp2PeOgfl9OjdxVY9p6fT7vzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748677; 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=QIPnijE6N6VvPZIFXdaD7cA5kFZsGhnQmO5oFJ3T+ss=; b=B+qFDL9uBMGY7oS4qQaoI4eDCdLMLKW6el8/6KNP2sZdO5drmWRZJp5QR+svVaIVe8NGCn jM2o2Ma8X7H00qbdEyqTqD7LEpT2YIAksoje+BtUmPEMHBrqUUjeXuXKewfqT4UQTSrQ0N GkykXQghiYkIMjlLTcrdjLJ+n41S2jCzsNXYgrqayPizWW1Td34bFQyIZBe61vC4ALlhiy V63qXuO8DcJ0iFNv4p5Kxx3/gQep2VLdzT/+VYyb10qVmHcwlqsflDfpkgzMJyiJScyoqU 4D/symg1cu1FAbfNSqxyzlRjiWJkvZtZyd4gCEZoHIbkI5U8uX76YLrTZjG3dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688748677; a=rsa-sha256; cv=none; b=baDBH1lseJNcSAgeAIX5dP6jhCfPBnkCLp5AZpWlDPtyI6n76tHZot+QxosrixEHcvMrn7 zplAOXcEEfb8XeNgOl4pnJhLY2pIRvFEOv4YJYd0KOs1kQCCw1D53r34/OlB8faxQRlpJR O3+bEYWNhEnM0wK2zJBREj5Wg+iwRbXLCbYP7/GhwkgVFEfDJr8JiGxa3TgpDYcbWWFkxc Jv/av8rBv2DtX2iGnZl48EnListIbQB+EjxGWulMbayl6/nxs88+IfEZHw8NjXwHh0jUz+ aXUyI4oyl5goazNIbiROeTmZ1uiitZyZ80pnkxMdydf3Rk21rwVzIQB0l//kwQ== 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 4QyKD52FNxzmLk; Fri, 7 Jul 2023 16:51:17 +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 367GpHdR010804; Fri, 7 Jul 2023 16:51:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 367GpH6P010803; Fri, 7 Jul 2023 16:51:17 GMT (envelope-from git) Date: Fri, 7 Jul 2023 16:51:17 GMT Message-Id: <202307071651.367GpH6P010803@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: a2cc93ec7fa1 - 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: a2cc93ec7fa15eed4d3a39998adff641c15dca4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2cc93ec7fa15eed4d3a39998adff641c15dca4f commit a2cc93ec7fa15eed4d3a39998adff641c15dca4f 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/pnfsdscopymr/pnfsdscopymr.c | 2 +- usr.sbin/pnfsdsfile/pnfsdsfile.c | 2 +- usr.sbin/pnfsdskill/pnfsdskill.c | 2 +- usr.sbin/quotaon/quotaon.c | 2 +- usr.sbin/repquota/repquota.c | 2 +- usr.sbin/rip6query/rip6query.c | 7 +++---- usr.sbin/rtprio/rtprio.c | 2 +- usr.sbin/rwhod/rwhod.c | 2 +- usr.sbin/setfib/setfib.c | 2 +- usr.sbin/spray/spray.c | 2 +- usr.sbin/tcpdrop/tcpdrop.c | 2 +- 11 files changed, 13 insertions(+), 14 deletions(-) diff --git a/usr.sbin/pnfsdscopymr/pnfsdscopymr.c b/usr.sbin/pnfsdscopymr/pnfsdscopymr.c index 33dcd302ef73..7a6eb298fa8d 100644 --- a/usr.sbin/pnfsdscopymr/pnfsdscopymr.c +++ b/usr.sbin/pnfsdscopymr/pnfsdscopymr.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; static struct option longopts[] = { { "migrate", required_argument, NULL, 'm' }, diff --git a/usr.sbin/pnfsdsfile/pnfsdsfile.c b/usr.sbin/pnfsdsfile/pnfsdsfile.c index ca17586dd3bd..7669f1f29b93 100644 --- a/usr.sbin/pnfsdsfile/pnfsdsfile.c +++ b/usr.sbin/pnfsdsfile/pnfsdsfile.c @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; static struct option longopts[] = { { "changeds", required_argument, NULL, 'c' }, diff --git a/usr.sbin/pnfsdskill/pnfsdskill.c b/usr.sbin/pnfsdskill/pnfsdskill.c index dcca4a17b626..878ca584d142 100644 --- a/usr.sbin/pnfsdskill/pnfsdskill.c +++ b/usr.sbin/pnfsdskill/pnfsdskill.c @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; static struct option longopts[] = { { "force", no_argument, NULL, 'f' }, diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c index f5340c6b44c5..224da3b2032c 100644 --- a/usr.sbin/quotaon/quotaon.c +++ b/usr.sbin/quotaon/quotaon.c @@ -70,7 +70,7 @@ static int vflag; /* verbose */ static int oneof(char *, char *[], int); static int quotaonoff(struct fstab *fs, int, int); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c index 23abcca93752..9fc8829ad1b6 100644 --- a/usr.sbin/repquota/repquota.c +++ b/usr.sbin/repquota/repquota.c @@ -104,7 +104,7 @@ int oneof(char *, char *[], int); int repquota(struct fstab *, int); char *timeprt(time_t); static void prthumanval(int64_t bytes); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.sbin/rip6query/rip6query.c b/usr.sbin/rip6query/rip6query.c index b3d745965965..549e05c4bae6 100644 --- a/usr.sbin/rip6query/rip6query.c +++ b/usr.sbin/rip6query/rip6query.c @@ -62,7 +62,7 @@ static struct rip6 *ripbuf; #define RIPSIZE(n) (sizeof(struct rip6) + (n-1) * sizeof(struct netinfo6)) int main(int, char **); -static void usage(void); +static void usage(void) __dead2; static const char *sa_n2a(struct sockaddr *); static const char *inet6_n2a(struct in6_addr *); @@ -90,7 +90,6 @@ main(int argc, char *argv[]) break; default: usage(); - exit(1); /*NOTREACHED*/ } } @@ -99,7 +98,6 @@ main(int argc, char *argv[]) if (argc != 1) { usage(); - exit(1); } if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { @@ -168,13 +166,14 @@ main(int argc, char *argv[]) } } while (len == RIPSIZE(24)); - exit(0); + return 0; } static void usage(void) { fprintf(stderr, "usage: rip6query [-I iface] address\n"); + exit(1); } /* getnameinfo() is preferred as we may be able to show ifindex as ifname */ diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c index 9ce74b5547ad..f8da2cc96290 100644 --- a/usr.sbin/rtprio/rtprio.c +++ b/usr.sbin/rtprio/rtprio.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include static int parseint(const char *, const char *); -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 23c307e33829..1b2b2b153a0f 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -137,7 +137,7 @@ void run_as(uid_t *uid, gid_t *gid); void quit(const char *msg); void sender_process(void); int verify(char *name, int maxlen); -static void usage(void); +static void usage(void) __dead2; #ifdef DEBUG char *interval(int time, char *updown); diff --git a/usr.sbin/setfib/setfib.c b/usr.sbin/setfib/setfib.c index 0783a07f4597..1c8adbc988da 100644 --- a/usr.sbin/setfib/setfib.c +++ b/usr.sbin/setfib/setfib.c @@ -45,7 +45,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/spray/spray.c b/usr.sbin/spray/spray.c index d8d25ef8a33c..18caf3ff3bd9 100644 --- a/usr.sbin/spray/spray.c +++ b/usr.sbin/spray/spray.c @@ -47,7 +47,7 @@ static const char rcsid[] = #define SPRAYOVERHEAD 86 #endif -static void usage(void); +static void usage(void) __dead2; static void print_xferstats(unsigned int, int, double); /* spray buffer */ diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c index 135f1b52c403..018ef8456e6a 100644 --- a/usr.sbin/tcpdrop/tcpdrop.c +++ b/usr.sbin/tcpdrop/tcpdrop.c @@ -58,7 +58,7 @@ static bool tcpdropall(const char *, const char *, int); static bool tcpdropbyname(const char *, const char *, const char *, const char *); static bool tcpdropconn(const struct in_conninfo *); -static void usage(void); +static void usage(void) __dead2; /* * Drop a tcp connection.