aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2009-12-11 23:35:38 +0000
committerXin LI <delphij@FreeBSD.org>2009-12-11 23:35:38 +0000
commit6f2d322192a3949db6e0f0b4bad4c763abc52bed (patch)
tree1c4d97908b52dc5263d006038b9af6b5ca886ca8
parente87862f53a119884d2103da7ba52cf7d14426803 (diff)
downloadsrc-6f2d322192a3949db6e0f0b4bad4c763abc52bed.tar.gz
src-6f2d322192a3949db6e0f0b4bad4c763abc52bed.zip
Remove unneeded header includes from usr.bin/ except contributed code.
Tested with: make universe
Notes
Notes: svn path=/head/; revision=200420
-rw-r--r--usr.bin/ar/util.c1
-rw-r--r--usr.bin/c89/c89.c1
-rw-r--r--usr.bin/calendar/calendar.c1
-rw-r--r--usr.bin/calendar/day.c1
-rw-r--r--usr.bin/calendar/ostern.c1
-rw-r--r--usr.bin/calendar/paskha.c1
-rw-r--r--usr.bin/cksum/Makefile1
-rw-r--r--usr.bin/cksum/crc.c1
-rw-r--r--usr.bin/cksum/crc32.c1
-rw-r--r--usr.bin/cksum/sum1.c1
-rw-r--r--usr.bin/cksum/sum2.c1
-rw-r--r--usr.bin/cmp/regular.c2
-rw-r--r--usr.bin/cmp/special.c1
-rw-r--r--usr.bin/colcrt/colcrt.c1
-rw-r--r--usr.bin/colrm/colrm.c3
-rw-r--r--usr.bin/compress/zopen.c2
-rw-r--r--usr.bin/cpuset/cpuset.c1
-rw-r--r--usr.bin/expand/expand.c1
-rw-r--r--usr.bin/fetch/fetch.c1
-rw-r--r--usr.bin/file2c/file2c.c1
-rw-r--r--usr.bin/find/find.c1
-rw-r--r--usr.bin/find/getdate.y1
-rw-r--r--usr.bin/find/ls.c1
-rw-r--r--usr.bin/find/main.c1
-rw-r--r--usr.bin/find/misc.c1
-rw-r--r--usr.bin/find/option.c1
-rw-r--r--usr.bin/finger/lprint.c2
-rw-r--r--usr.bin/finger/net.c2
-rw-r--r--usr.bin/finger/util.c2
-rw-r--r--usr.bin/fmt/fmt.c1
-rw-r--r--usr.bin/fold/fold.c1
-rw-r--r--usr.bin/gcore/gcore.c1
-rw-r--r--usr.bin/getopt/getopt.c1
-rw-r--r--usr.bin/hexdump/display.c1
-rw-r--r--usr.bin/hexdump/hexdump.c1
-rw-r--r--usr.bin/jot/jot.c1
-rw-r--r--usr.bin/killall/killall.c2
-rw-r--r--usr.bin/ktrace/subr.c2
-rw-r--r--usr.bin/lastcomm/lastcomm.c3
-rw-r--r--usr.bin/lastcomm/pathnames.h4
-rw-r--r--usr.bin/lastcomm/readrec.c4
-rw-r--r--usr.bin/limits/limits.c1
-rw-r--r--usr.bin/lock/lock.c1
-rw-r--r--usr.bin/login/login.c2
-rw-r--r--usr.bin/login/login_fbtab.c1
-rw-r--r--usr.bin/login/pathnames.h2
-rw-r--r--usr.bin/mesg/mesg.c1
-rw-r--r--usr.bin/mkfifo/mkfifo.c1
-rw-r--r--usr.bin/mklocale/yacc.y1
-rw-r--r--usr.bin/mktemp/mktemp.c2
-rw-r--r--usr.bin/ncal/ncal.c1
-rw-r--r--usr.bin/netstat/atalk.c2
-rw-r--r--usr.bin/netstat/bpf.c1
-rw-r--r--usr.bin/netstat/if.c1
-rw-r--r--usr.bin/netstat/ipsec.c2
-rw-r--r--usr.bin/netstat/ipx.c2
-rw-r--r--usr.bin/netstat/main.c2
-rw-r--r--usr.bin/netstat/mbuf.c2
-rw-r--r--usr.bin/netstat/netgraph.c2
-rw-r--r--usr.bin/netstat/pfkey.c2
-rw-r--r--usr.bin/netstat/route.c1
-rw-r--r--usr.bin/netstat/sctp.c3
-rw-r--r--usr.bin/newgrp/newgrp.c2
-rw-r--r--usr.bin/newkey/update.c1
-rw-r--r--usr.bin/nfsstat/nfsstat.c2
-rw-r--r--usr.bin/nohup/nohup.c1
-rw-r--r--usr.bin/passwd/passwd.c1
-rw-r--r--usr.bin/paste/paste.c3
-rw-r--r--usr.bin/pr/egetopt.c3
-rw-r--r--usr.bin/procstat/procstat_args.c1
-rw-r--r--usr.bin/procstat/procstat_basic.c1
-rw-r--r--usr.bin/procstat/procstat_files.c1
-rw-r--r--usr.bin/procstat/procstat_vm.c1
-rw-r--r--usr.bin/rev/rev.c2
-rw-r--r--usr.bin/rlogin/rlogin.c2
-rw-r--r--usr.bin/rpcgen/rpc_clntout.c1
-rw-r--r--usr.bin/rpcgen/rpc_hout.c1
-rw-r--r--usr.bin/rpcgen/rpc_tblout.c1
-rw-r--r--usr.bin/rpcgen/rpc_util.c1
-rw-r--r--usr.bin/ruptime/ruptime.c1
-rw-r--r--usr.bin/rwall/rwall.c1
-rw-r--r--usr.bin/sed/main.c2
-rw-r--r--usr.bin/sed/misc.c6
-rw-r--r--usr.bin/showmount/showmount.c1
-rw-r--r--usr.bin/su/su.c1
-rw-r--r--usr.bin/systat/fetch.c1
-rw-r--r--usr.bin/systat/icmp.c2
-rw-r--r--usr.bin/systat/iostat.c1
-rw-r--r--usr.bin/systat/ip.c4
-rw-r--r--usr.bin/systat/main.c1
-rw-r--r--usr.bin/systat/mbufs.c1
-rw-r--r--usr.bin/systat/mode.c2
-rw-r--r--usr.bin/systat/netstat.c1
-rw-r--r--usr.bin/systat/swap.c1
-rw-r--r--usr.bin/systat/tcp.c2
-rw-r--r--usr.bin/systat/vmstat.c1
-rw-r--r--usr.bin/tar/getdate.c2
-rw-r--r--usr.bin/tee/tee.c1
-rw-r--r--usr.bin/time/time.c1
-rw-r--r--usr.bin/tput/tput.c2
-rw-r--r--usr.bin/tr/cmap.c3
-rw-r--r--usr.bin/tr/cmap.h1
-rw-r--r--usr.bin/tr/cset.c3
-rw-r--r--usr.bin/tr/cset.h1
-rw-r--r--usr.bin/tr/str.c2
-rw-r--r--usr.bin/tr/tr.c4
-rw-r--r--usr.bin/truss/main.c2
-rw-r--r--usr.bin/truss/setup.c4
-rw-r--r--usr.bin/tsort/tsort.c1
-rw-r--r--usr.bin/ul/ul.c1
-rw-r--r--usr.bin/unexpand/unexpand.c2
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c1
-rw-r--r--usr.bin/vis/foldit.c6
-rw-r--r--usr.bin/w/pr_time.c1
-rw-r--r--usr.bin/w/w.c3
-rw-r--r--usr.bin/wall/ttymsg.c1
-rw-r--r--usr.bin/who/who.c1
-rw-r--r--usr.bin/xinstall/xinstall.c21
-rw-r--r--usr.bin/ypcat/ypcat.c1
-rw-r--r--usr.bin/ypmatch/ypmatch.c1
-rw-r--r--usr.bin/ypwhich/ypwhich.c1
121 files changed, 19 insertions, 193 deletions
diff --git a/usr.bin/ar/util.c b/usr.bin/ar/util.c
index e1230e330134..621c2b8a1978 100644
--- a/usr.bin/ar/util.c
+++ b/usr.bin/ar/util.c
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include <sys/queue.h>
#include <sys/types.h>
-#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/c89/c89.c b/usr.bin/c89/c89.c
index a1dc9b2a6238..f8c47c5d11f7 100644
--- a/usr.bin/c89/c89.c
+++ b/usr.bin/c89/c89.c
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index d1bb74516d98..39f2c9ce23f9 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
#include <time.h>
#include <unistd.h>
-#include "pathnames.h"
#include "calendar.h"
struct passwd *pw;
diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c
index d3f3c1ec4f29..e40481eb918a 100644
--- a/usr.bin/calendar/day.c
+++ b/usr.bin/calendar/day.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <time.h>
-#include "pathnames.h"
#include "calendar.h"
struct tm *tp;
diff --git a/usr.bin/calendar/ostern.c b/usr.bin/calendar/ostern.c
index 76e593327a39..93e9c07b44fb 100644
--- a/usr.bin/calendar/ostern.c
+++ b/usr.bin/calendar/ostern.c
@@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include "calendar.h"
diff --git a/usr.bin/calendar/paskha.c b/usr.bin/calendar/paskha.c
index d96ffc2546e0..e713f5f9be9e 100644
--- a/usr.bin/calendar/paskha.c
+++ b/usr.bin/calendar/paskha.c
@@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include "calendar.h"
diff --git a/usr.bin/cksum/Makefile b/usr.bin/cksum/Makefile
index 828900ac0273..7ba38032fdb0 100644
--- a/usr.bin/cksum/Makefile
+++ b/usr.bin/cksum/Makefile
@@ -5,5 +5,6 @@ PROG= cksum
SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c
LINKS= ${BINDIR}/cksum ${BINDIR}/sum
MLINKS= cksum.1 sum.1
+WARNS?= 6
.include <bsd.prog.mk>
diff --git a/usr.bin/cksum/crc.c b/usr.bin/cksum/crc.c
index d1f42f2f628c..ee48278c38f3 100644
--- a/usr.bin/cksum/crc.c
+++ b/usr.bin/cksum/crc.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <stdint.h>
#include <unistd.h>
#include "extern.h"
diff --git a/usr.bin/cksum/crc32.c b/usr.bin/cksum/crc32.c
index cadbc17b69bb..eefa7724eb9d 100644
--- a/usr.bin/cksum/crc32.c
+++ b/usr.bin/cksum/crc32.c
@@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <stdio.h>
-#include <stdint.h>
#include <unistd.h>
#include "extern.h"
diff --git a/usr.bin/cksum/sum1.c b/usr.bin/cksum/sum1.c
index 406b40e2832f..e6dd910bfee4 100644
--- a/usr.bin/cksum/sum1.c
+++ b/usr.bin/cksum/sum1.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <unistd.h>
-#include <stdint.h>
#include "extern.h"
diff --git a/usr.bin/cksum/sum2.c b/usr.bin/cksum/sum2.c
index c179c6289a2f..b4380623a64c 100644
--- a/usr.bin/cksum/sum2.c
+++ b/usr.bin/cksum/sum2.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <unistd.h>
-#include <stdint.h>
#include "extern.h"
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index 814d9333b938..555725a999bc 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -45,12 +45,10 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include "extern.h"
diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c
index bbe3cb10fa81..e5e8325d109b 100644
--- a/usr.bin/cmp/special.c
+++ b/usr.bin/cmp/special.c
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include "extern.h"
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c
index 2ba4f39bbdae..f8452514d8ce 100644
--- a/usr.bin/colcrt/colcrt.c
+++ b/usr.bin/colcrt/colcrt.c
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 52dda90086dd..399252aaa343 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -48,12 +48,9 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <err.h>
-#include <errno.h>
-#include <limits.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c
index f0ec8871cd81..92e0a971fea1 100644
--- a/usr.bin/compress/zopen.c
+++ b/usr.bin/compress/zopen.c
@@ -67,13 +67,11 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
-#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "zopen.h"
#define BITS 16 /* Default bits. */
diff --git a/usr.bin/cpuset/cpuset.c b/usr.bin/cpuset/cpuset.c
index 35b13afa0a4e..a2bcf889d4d9 100644
--- a/usr.bin/cpuset/cpuset.c
+++ b/usr.bin/cpuset/cpuset.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
-#include <string.h>
int cflag;
int gflag;
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index 6c99db806856..9f04799d911b 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
#include <wchar.h>
-#include <wctype.h>
/*
* expand - expand tabs to equivalent spaces
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 2512a2e8632c..8fe419b7b051 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/time.h>
-#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
diff --git a/usr.bin/file2c/file2c.c b/usr.bin/file2c/file2c.c
index e50bd1f8a46d..8affbd07f783 100644
--- a/usr.bin/file2c/file2c.c
+++ b/usr.bin/file2c/file2c.c
@@ -10,7 +10,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index cc2d797a541d..3171f8ba595b 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <fts.h>
#include <regex.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "find.h"
diff --git a/usr.bin/find/getdate.y b/usr.bin/find/getdate.y
index de7750c88ff5..0a7ab21087ad 100644
--- a/usr.bin/find/getdate.y
+++ b/usr.bin/find/getdate.y
@@ -15,7 +15,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <stdio.h>
#include <ctype.h>
/* The code at the top of get_date which figures out the offset of the
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c
index 88e45938cc6d..7b9d88f4731b 100644
--- a/usr.bin/find/ls.c
+++ b/usr.bin/find/ls.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <fts.h>
#include <grp.h>
#include <inttypes.h>
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 8e2b42cd298c..9a0b9ce4c744 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <fts.h>
#include <locale.h>
diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c
index 15329064cf44..8fda57c87dfb 100644
--- a/usr.bin/find/misc.c
+++ b/usr.bin/find/misc.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <fts.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c
index 7d06c910ae70..6c76bbfa89ba 100644
--- a/usr.bin/find/option.c
+++ b/usr.bin/find/option.c
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <fts.h>
#include <regex.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c
index 848bbeeeb324..d656693f0aab 100644
--- a/usr.bin/finger/lprint.c
+++ b/usr.bin/finger/lprint.c
@@ -310,7 +310,7 @@ show_text(const char *directory, const char *file_name, const char *header)
return(0);
/* If short enough, and no newlines, show it on a single line.*/
- if (sb.st_size <= LINE_LEN - strlen(header) - 5) {
+ if (sb.st_size <= (int)(LINE_LEN - strlen(header) - 5)) {
nr = read(fd, tbuf, sizeof(tbuf));
if (nr <= 0) {
(void)close(fd);
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index 5260a2d6ca29..703ff60a86a7 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -230,7 +230,7 @@ trying(const struct addrinfo *ai)
printf("Trying %s...\n", buf);
}
-void
+static void
cleanup(int sig __unused)
{
#define ERRSTR "Timed out.\n"
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index a84c711745c7..3eabd34b37db 100644
--- a/usr.bin/finger/util.c
+++ b/usr.bin/finger/util.c
@@ -120,7 +120,7 @@ enter_lastlog(PERSON *pn)
}
if (fd == -1 ||
lseek(fd, (long)pn->uid * sizeof(ll), SEEK_SET) !=
- (long)pn->uid * sizeof(ll) ||
+ (off_t)(pn->uid * sizeof(ll)) ||
read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) {
/* as if never logged in */
ll.ll_line[0] = ll.ll_host[0] = '\0';
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index ed85c2e49f2a..1ce933468657 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -180,7 +180,6 @@ __FBSDID("$FreeBSD$");
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sysexits.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index 59d8fc59adfd..6c7fafb4553d 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
#include <wctype.h>
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index 35d5363f143a..706620c0c397 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include "extern.h"
diff --git a/usr.bin/getopt/getopt.c b/usr.bin/getopt/getopt.c
index d1671a71e5ee..d0355d83e7c7 100644
--- a/usr.bin/getopt/getopt.c
+++ b/usr.bin/getopt/getopt.c
@@ -7,7 +7,6 @@ __FBSDID("$FreeBSD$");
*/
#include <stdio.h>
-#include <stdlib.h>
#include <unistd.h>
int
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c
index db04c49aade5..3d6a6ea8ba43 100644
--- a/usr.bin/hexdump/display.c
+++ b/usr.bin/hexdump/display.c
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "hexdump.h"
enum _vflag vflag = FIRST;
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c
index 2ed7c4b9df49..a03553173166 100644
--- a/usr.bin/hexdump/hexdump.c
+++ b/usr.bin/hexdump/hexdump.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <locale.h>
#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#include "hexdump.h"
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index 2e33d41be590..4cd7433556f2 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
/* Defaults */
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c
index 0a779fdcbc3d..6ac53ddcdcbb 100644
--- a/usr.bin/killall/killall.c
+++ b/usr.bin/killall/killall.c
@@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <sys/user.h>
#include <sys/sysctl.h>
-#include <fcntl.h>
-#include <dirent.h>
#include <jail.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c
index a9d3f6442cb0..4f41a13a1b43 100644
--- a/usr.bin/ktrace/subr.c
+++ b/usr.bin/ktrace/subr.c
@@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <sys/ktrace.h>
-#include <stdio.h>
-
#include "ktrace.h"
void timevaladd(struct timeval *, struct timeval *);
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c
index 8c551231a4fc..b5ca6dddd378 100644
--- a/usr.bin/lastcomm/lastcomm.c
+++ b/usr.bin/lastcomm/lastcomm.c
@@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/lastcomm/pathnames.h b/usr.bin/lastcomm/pathnames.h
index 0737970dab93..04af44020648 100644
--- a/usr.bin/lastcomm/pathnames.h
+++ b/usr.bin/lastcomm/pathnames.h
@@ -31,8 +31,8 @@
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 6/6/93
+ *
+ * $FreeBSD$
*/
-#include <paths.h>
-
#define _PATH_ACCT "/var/account/acct"
diff --git a/usr.bin/lastcomm/readrec.c b/usr.bin/lastcomm/readrec.c
index 4883b2a4ef88..5de7c5c4c808 100644
--- a/usr.bin/lastcomm/readrec.c
+++ b/usr.bin/lastcomm/readrec.c
@@ -33,13 +33,9 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/acct.h>
-#include <ctype.h>
-#include <err.h>
#include <errno.h>
-#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
int readrec_forward(FILE *f, struct acctv2 *av2);
diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c
index 2da69a23c64f..9c250f9f40c0 100644
--- a/usr.bin/limits/limits.c
+++ b/usr.bin/limits/limits.c
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <stdlib.h>
#include <unistd.h>
-#include <stdarg.h>
#include <stdint.h>
#include <ctype.h>
#include <errno.h>
diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c
index 3b19e35bbe1c..d5812847fd61 100644
--- a/usr.bin/lock/lock.c
+++ b/usr.bin/lock/lock.c
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
#include <sys/signal.h>
#include <sys/consio.h>
#include <err.h>
-#include <ctype.h>
#include <errno.h>
#include <pwd.h>
#include <stdio.h>
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index 2a429247d9a0..dd63d9233b62 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <grp.h>
-#include <libutil.h>
#include <login_cap.h>
+#include <paths.h>
#include <pwd.h>
#include <setjmp.h>
#include <signal.h>
diff --git a/usr.bin/login/login_fbtab.c b/usr.bin/login/login_fbtab.c
index f6111a1cd352..c3cb8f4e736a 100644
--- a/usr.bin/login/login_fbtab.c
+++ b/usr.bin/login/login_fbtab.c
@@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$");
#include <syslog.h>
#include <unistd.h>
-#include "login.h"
#include "pathnames.h"
static void login_protect(const char *, char *, int, uid_t, gid_t);
diff --git a/usr.bin/login/pathnames.h b/usr.bin/login/pathnames.h
index 60fecc241149..afb06efc6ba8 100644
--- a/usr.bin/login/pathnames.h
+++ b/usr.bin/login/pathnames.h
@@ -34,8 +34,6 @@
* $FreeBSD$
*/
-#include <paths.h>
-
#define _PATH_HUSHLOGIN ".hushlogin"
#define _PATH_MOTDFILE "/etc/motd"
#define _PATH_FBTAB "/etc/fbtab"
diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c
index 270c1c546b5c..7f891cc399c9 100644
--- a/usr.bin/mesg/mesg.c
+++ b/usr.bin/mesg/mesg.c
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
static void usage(void);
diff --git a/usr.bin/mkfifo/mkfifo.c b/usr.bin/mkfifo/mkfifo.c
index 7e147b6b1497..468656203e4e 100644
--- a/usr.bin/mkfifo/mkfifo.c
+++ b/usr.bin/mkfifo/mkfifo.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y
index 344af220cf6b..99d86e6b7fc2 100644
--- a/usr.bin/mklocale/yacc.y
+++ b/usr.bin/mklocale/yacc.y
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
-#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c
index b58ac4b9d055..72b89d607889 100644
--- a/usr.bin/mktemp/mktemp.c
+++ b/usr.bin/mktemp/mktemp.c
@@ -143,7 +143,7 @@ main(int argc, char **argv)
}
static void
-usage()
+usage(void)
{
fprintf(stderr,
"usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n");
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c
index a65a2fcf8a2d..4699025301b2 100644
--- a/usr.bin/ncal/ncal.c
+++ b/usr.bin/ncal/ncal.c
@@ -30,7 +30,6 @@ static const char rcsid[] =
#endif /* not lint */
#include <calendar.h>
-#include <ctype.h>
#include <err.h>
#include <langinfo.h>
#include <locale.h>
diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c
index 9ed48209076d..cf82020bb271 100644
--- a/usr.bin/netstat/atalk.c
+++ b/usr.bin/netstat/atalk.c
@@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$");
#include <netatalk/at.h>
#include <netatalk/ddp_var.h>
-#include <errno.h>
-#include <nlist.h>
#include <netdb.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c
index 2ffeacbc7dea..2f862e19ebf0 100644
--- a/usr.bin/netstat/bpf.c
+++ b/usr.bin/netstat/bpf.c
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "netstat.h"
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 02f390a01964..043a20ff0eab 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "netstat.h"
diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c
index d3276bf27615..8aeeacee33f6 100644
--- a/usr.bin/netstat/ipsec.c
+++ b/usr.bin/netstat/ipsec.c
@@ -111,8 +111,6 @@ __FBSDID("$FreeBSD$");
#include <stdint.h>
#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
#include "netstat.h"
#ifdef IPSEC
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index b79a93bba984..adc6cfb5ac84 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$");
#define SANAMES
#include <netipx/spx_debug.h>
-#include <nlist.h>
-#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index fec7172ad0c6..23593d58ff6f 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -60,12 +60,10 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
-#include <errno.h>
#include <kvm.h>
#include <limits.h>
#include <netdb.h>
#include <nlist.h>
-#include <paths.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c
index 7f65701ddf5e..47a58c4efa63 100644
--- a/usr.bin/netstat/mbuf.c
+++ b/usr.bin/netstat/mbuf.c
@@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$");
#include <memstat.h>
#include <stdint.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "netstat.h"
/*
diff --git a/usr.bin/netstat/netgraph.c b/usr.bin/netstat/netgraph.c
index c4dd647eb6fd..adae25e639dc 100644
--- a/usr.bin/netstat/netgraph.c
+++ b/usr.bin/netstat/netgraph.c
@@ -50,11 +50,9 @@ __FBSDID("$FreeBSD$");
#include <netgraph/ng_socketvar.h>
#include <nlist.h>
-#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <err.h>
#include "netstat.h"
diff --git a/usr.bin/netstat/pfkey.c b/usr.bin/netstat/pfkey.c
index 2ab58e91dada..22a64219bb92 100644
--- a/usr.bin/netstat/pfkey.c
+++ b/usr.bin/netstat/pfkey.c
@@ -83,8 +83,6 @@ __FBSDID("$FreeBSD$");
#include <stdint.h>
#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
#include "netstat.h"
#ifdef IPSEC
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 2e9e919f109b..db7a4d117e33 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
-#include <unistd.h>
#include <err.h>
#include "netstat.h"
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c
index fe29787ef197..82a4c13cfccf 100644
--- a/usr.bin/netstat/sctp.c
+++ b/usr.bin/netstat/sctp.c
@@ -52,13 +52,10 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
-#include <libutil.h>
-#include <netdb.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "netstat.h"
#ifdef SCTP
diff --git a/usr.bin/newgrp/newgrp.c b/usr.bin/newgrp/newgrp.c
index 91b62a52779d..b5e040211f26 100644
--- a/usr.bin/newgrp/newgrp.c
+++ b/usr.bin/newgrp/newgrp.c
@@ -34,10 +34,8 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <err.h>
-#include <errno.h>
#include <grp.h>
#include <libgen.h>
-#include <limits.h>
#include <login_cap.h>
#include <paths.h>
#include <pwd.h>
diff --git a/usr.bin/newkey/update.c b/usr.bin/newkey/update.c
index 11a1db94261a..eba42fc255fa 100644
--- a/usr.bin/newkey/update.c
+++ b/usr.bin/newkey/update.c
@@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
#include <netdb.h>
#endif /* YP */
-#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index 4af133b13701..aa964b83f7e6 100644
--- a/usr.bin/nfsstat/nfsstat.c
+++ b/usr.bin/nfsstat/nfsstat.c
@@ -62,7 +62,6 @@ static const char rcsid[] =
#include <signal.h>
#include <fcntl.h>
-#include <ctype.h>
#include <errno.h>
#include <kvm.h>
#include <limits.h>
@@ -71,7 +70,6 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <paths.h>
#include <err.h>
struct nlist nl[] = {
diff --git a/usr.bin/nohup/nohup.c b/usr.bin/nohup/nohup.c
index 06f22445771d..aa3109ceab2e 100644
--- a/usr.bin/nohup/nohup.c
+++ b/usr.bin/nohup/nohup.c
@@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
static void dofile(void);
diff --git a/usr.bin/passwd/passwd.c b/usr.bin/passwd/passwd.c
index d35458c956a1..dd12a562324a 100644
--- a/usr.bin/passwd/passwd.c
+++ b/usr.bin/passwd/passwd.c
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
-#include <syslog.h>
#include <unistd.h>
#include <security/pam_appl.h>
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index 6e3e5539d0c0..72c27365aec8 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -52,12 +52,9 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <err.h>
-#include <errno.h>
-#include <limits.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/usr.bin/pr/egetopt.c b/usr.bin/pr/egetopt.c
index 277459ee47a7..cf42d7c44636 100644
--- a/usr.bin/pr/egetopt.c
+++ b/usr.bin/pr/egetopt.c
@@ -46,11 +46,8 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include "extern.h"
-
/*
* egetopt: get option letter from argument vector (an extended
* version of getopt).
diff --git a/usr.bin/procstat/procstat_args.c b/usr.bin/procstat/procstat_args.c
index e5a7acda9214..1c132ca540c0 100644
--- a/usr.bin/procstat/procstat_args.c
+++ b/usr.bin/procstat/procstat_args.c
@@ -34,7 +34,6 @@
#include <errno.h>
#include <limits.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "procstat.h"
diff --git a/usr.bin/procstat/procstat_basic.c b/usr.bin/procstat/procstat_basic.c
index 277517242a4d..00109e787f0c 100644
--- a/usr.bin/procstat/procstat_basic.c
+++ b/usr.bin/procstat/procstat_basic.c
@@ -30,7 +30,6 @@
#include <sys/sysctl.h>
#include <sys/user.h>
-#include <err.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c
index debb0e44a20f..984dced8929f 100644
--- a/usr.bin/procstat/procstat_files.c
+++ b/usr.bin/procstat/procstat_files.c
@@ -36,7 +36,6 @@
#include <arpa/inet.h>
-#include <err.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c
index 5c965a990767..2d3a666ea42a 100644
--- a/usr.bin/procstat/procstat_vm.c
+++ b/usr.bin/procstat/procstat_vm.c
@@ -30,7 +30,6 @@
#include <sys/sysctl.h>
#include <sys/user.h>
-#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c
index 8b38897d2f6c..66a7ad23938b 100644
--- a/usr.bin/rev/rev.c
+++ b/usr.bin/rev/rev.c
@@ -49,11 +49,9 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <err.h>
-#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index c279535b6497..971de675ec61 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -72,9 +72,7 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <libutil.h>
#include <netdb.h>
-#include <paths.h>
#include <pwd.h>
#include <setjmp.h>
#include <termios.h>
diff --git a/usr.bin/rpcgen/rpc_clntout.c b/usr.bin/rpcgen/rpc_clntout.c
index 713cba11d55a..76c9b93cb1f8 100644
--- a/usr.bin/rpcgen/rpc_clntout.c
+++ b/usr.bin/rpcgen/rpc_clntout.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
* Copyright (C) 1987, Sun Microsytsems, Inc.
*/
#include <stdio.h>
-#include <string.h>
#include <rpc/types.h>
#include "rpc_parse.h"
#include "rpc_scan.h"
diff --git a/usr.bin/rpcgen/rpc_hout.c b/usr.bin/rpcgen/rpc_hout.c
index 70683638360e..ce92fe24c13f 100644
--- a/usr.bin/rpcgen/rpc_hout.c
+++ b/usr.bin/rpcgen/rpc_hout.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
* Copyright (C) 1987, Sun Microsystems, Inc.
*/
#include <stdio.h>
-#include <ctype.h>
#include "rpc_parse.h"
#include "rpc_scan.h"
#include "rpc_util.h"
diff --git a/usr.bin/rpcgen/rpc_tblout.c b/usr.bin/rpcgen/rpc_tblout.c
index f96bdfcbc187..736f857484e8 100644
--- a/usr.bin/rpcgen/rpc_tblout.c
+++ b/usr.bin/rpcgen/rpc_tblout.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
*/
#include <err.h>
#include <stdio.h>
-#include <string.h>
#include "rpc_parse.h"
#include "rpc_scan.h"
#include "rpc_util.h"
diff --git a/usr.bin/rpcgen/rpc_util.c b/usr.bin/rpcgen/rpc_util.c
index 9d1c85be5f1c..408056535462 100644
--- a/usr.bin/rpcgen/rpc_util.c
+++ b/usr.bin/rpcgen/rpc_util.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
* Copyright (C) 1989, Sun Microsystems, Inc.
*/
#include <err.h>
-#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c
index 1e3356f6f86c..b8672e4e46d0 100644
--- a/usr.bin/ruptime/ruptime.c
+++ b/usr.bin/ruptime/ruptime.c
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <dirent.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index 042b72f71355..d104bde8dbe8 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <time.h>
#include <unistd.h>
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 1a140b144142..f99c12a4132a 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -51,12 +51,10 @@ static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
#include <err.h>
#include <errno.h>
-#include <fcntl.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <regex.h>
-#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c
index f3b513784a6e..4a7f643e9baa 100644
--- a/usr.bin/sed/misc.c
+++ b/usr.bin/sed/misc.c
@@ -41,14 +41,8 @@ static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#include <sys/types.h>
#include <err.h>
-#include <limits.h>
#include <regex.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-
-#include "defs.h"
-#include "extern.h"
/*
* Return a string for a regular expression error passed. This is overkill,
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index 5e67cc1bc7bb..0a63a32ed2c9 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -55,7 +55,6 @@ static const char rcsid[] =
#include <sys/socketvar.h>
#include <err.h>
-#include <netdb.h>
#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
#include <rpc/pmap_prot.h>
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index 5dcb24a4064e..88a19d9e6496 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
-#include <grp.h>
#include <login_cap.h>
#include <paths.h>
#include <pwd.h>
diff --git a/usr.bin/systat/fetch.c b/usr.bin/systat/fetch.c
index 0edce342e7b2..124c3b9763f1 100644
--- a/usr.bin/systat/fetch.c
+++ b/usr.bin/systat/fetch.c
@@ -42,7 +42,6 @@ static const char sccsid[] = "@(#)fetch.c 8.1 (Berkeley) 6/6/93";
#include <sys/types.h>
#include <sys/sysctl.h>
-#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/systat/icmp.c b/usr.bin/systat/icmp.c
index 2d5f8e4e1ff9..acf6b3fca99c 100644
--- a/usr.bin/systat/icmp.c
+++ b/usr.bin/systat/icmp.c
@@ -54,9 +54,7 @@ static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
-#include <stdlib.h>
#include <string.h>
-#include <paths.h>
#include "systat.h"
#include "extern.h"
#include "mode.h"
diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c
index 90e1578efeb7..d3573af5546c 100644
--- a/usr.bin/systat/iostat.c
+++ b/usr.bin/systat/iostat.c
@@ -73,7 +73,6 @@ static const char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93";
#include <devstat.h>
#include <err.h>
#include <nlist.h>
-#include <paths.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/systat/ip.c b/usr.bin/systat/ip.c
index 091432857516..44ed6ac97069 100644
--- a/usr.bin/systat/ip.c
+++ b/usr.bin/systat/ip.c
@@ -55,10 +55,6 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <netinet/udp.h>
#include <netinet/udp_var.h>
-#include <stdlib.h>
-#include <string.h>
-#include <paths.h>
-
#include "systat.h"
#include "extern.h"
#include "mode.h"
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index d092f10fe19a..90c6208759d6 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -53,7 +53,6 @@ static const char copyright[] =
#include <limits.h>
#include <locale.h>
#include <nlist.h>
-#include <paths.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c
index 37be1ef3d593..9b0d4a8c22ca 100644
--- a/usr.bin/systat/mbufs.c
+++ b/usr.bin/systat/mbufs.c
@@ -47,7 +47,6 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <paths.h>
#include "systat.h"
#include "extern.h"
diff --git a/usr.bin/systat/mode.c b/usr.bin/systat/mode.c
index 5f64e3ec237f..745a283ff398 100644
--- a/usr.bin/systat/mode.c
+++ b/usr.bin/systat/mode.c
@@ -60,8 +60,6 @@
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-
#include "systat.h"
#include "extern.h"
#include "mode.h"
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index 14fc4956f343..eb469f3e06bc 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -74,7 +74,6 @@ static const char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93";
#include <netdb.h>
#include <nlist.h>
-#include <paths.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c
index 43df8eb8aa1e..dca29b508bf1 100644
--- a/usr.bin/systat/swap.c
+++ b/usr.bin/systat/swap.c
@@ -53,7 +53,6 @@ static const char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95";
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <err.h>
#include "systat.h"
#include "extern.h"
diff --git a/usr.bin/systat/tcp.c b/usr.bin/systat/tcp.c
index b7f7592208cf..4a69a4f0e2dc 100644
--- a/usr.bin/systat/tcp.c
+++ b/usr.bin/systat/tcp.c
@@ -57,9 +57,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
-#include <stdlib.h>
#include <string.h>
-#include <paths.h>
#include "systat.h"
#include "extern.h"
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 742e2f7b4f07..6585d938b265 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -60,7 +60,6 @@ static const char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#include <errno.h>
#include <langinfo.h>
#include <nlist.h>
-#include <paths.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/tar/getdate.c b/usr.bin/tar/getdate.c
index 8df1e26fba77..effac4e9d3da 100644
--- a/usr.bin/tar/getdate.c
+++ b/usr.bin/tar/getdate.c
@@ -33,8 +33,6 @@ __FBSDID("$FreeBSD$");
#endif
#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
index 123a2de69ab5..de592c5f2dfd 100644
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -52,7 +52,6 @@ static const char rcsid[] =
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
typedef struct _list {
diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index a97ffecce209..d586ba14c57f 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -59,7 +59,6 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <string.h>
#include <unistd.h>
static int getstathz(void);
diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c
index a478d5dcf49a..e3b8a37cebb8 100644
--- a/usr.bin/tput/tput.c
+++ b/usr.bin/tput/tput.c
@@ -45,8 +45,6 @@ static const char copyright[] =
static const char sccsid[] = "@(#)tput.c 8.2 (Berkeley) 3/19/94";
#endif
-#include <termios.h>
-
#include <err.h>
#include <termcap.h>
#include <stdio.h>
diff --git a/usr.bin/tr/cmap.c b/usr.bin/tr/cmap.c
index 811040c25e76..8c2ab972d983 100644
--- a/usr.bin/tr/cmap.c
+++ b/usr.bin/tr/cmap.c
@@ -33,10 +33,7 @@
__FBSDID("$FreeBSD$");
#include <assert.h>
-#include <limits.h>
-#include <stdbool.h>
#include <stdlib.h>
-#include <wchar.h>
#include "cmap.h"
static struct cmapnode *cmap_splay(struct cmapnode *, wint_t);
diff --git a/usr.bin/tr/cmap.h b/usr.bin/tr/cmap.h
index 9a81e134678f..a7c1a3015f6c 100644
--- a/usr.bin/tr/cmap.h
+++ b/usr.bin/tr/cmap.h
@@ -29,7 +29,6 @@
#ifndef CMAP_H
#define CMAP_H
-#include <limits.h>
#include <stdbool.h>
#include <wchar.h>
diff --git a/usr.bin/tr/cset.c b/usr.bin/tr/cset.c
index 1b4212949b6c..2535eed2d465 100644
--- a/usr.bin/tr/cset.c
+++ b/usr.bin/tr/cset.c
@@ -33,10 +33,7 @@
__FBSDID("$FreeBSD$");
#include <assert.h>
-#include <stdbool.h>
#include <stdlib.h>
-#include <wchar.h>
-#include <wctype.h>
#include "cset.h"
static struct csnode * cset_delete(struct csnode *, wchar_t);
diff --git a/usr.bin/tr/cset.h b/usr.bin/tr/cset.h
index ab3eabd3e439..4a8108a2db9a 100644
--- a/usr.bin/tr/cset.h
+++ b/usr.bin/tr/cset.h
@@ -30,7 +30,6 @@
#define CSET_H
#include <stdbool.h>
-#include <wchar.h>
#include <wctype.h>
struct csnode {
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c
index 86ae1731ac42..1dee776e06b9 100644
--- a/usr.bin/tr/str.c
+++ b/usr.bin/tr/str.c
@@ -44,8 +44,6 @@ static const char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
#include <ctype.h>
#include <err.h>
#include <errno.h>
-#include <stddef.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index 61195ff4dbb0..6db16af0f678 100644
--- a/usr.bin/tr/tr.c
+++ b/usr.bin/tr/tr.c
@@ -47,16 +47,12 @@ static const char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95";
#include <sys/types.h>
-#include <ctype.h>
#include <err.h>
-#include <limits.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <wchar.h>
-#include <wctype.h>
#include "cmap.h"
#include "cset.h"
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index d0dd073e632f..4036a63904ea 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c
index 53a6fe17f227..4f79ea30c202 100644
--- a/usr.bin/truss/setup.c
+++ b/usr.bin/truss/setup.c
@@ -43,13 +43,9 @@ __FBSDID("$FreeBSD$");
#include <sys/wait.h>
#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <time.h>
#include <unistd.h>
#include <machine/reg.h>
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index a01a86c3700c..e7c538e1d31e 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <db.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c
index 77559cf254fe..725fc25765e1 100644
--- a/usr.bin/ul/ul.c
+++ b/usr.bin/ul/ul.c
@@ -53,7 +53,6 @@ static const char rcsid[] =
#include <termcap.h>
#include <unistd.h>
#include <wchar.h>
-#include <wctype.h>
#define IESC '\033'
#define SO '\016'
diff --git a/usr.bin/unexpand/unexpand.c b/usr.bin/unexpand/unexpand.c
index d59cd4ef8c7a..5009ca1fbfd3 100644
--- a/usr.bin/unexpand/unexpand.c
+++ b/usr.bin/unexpand/unexpand.c
@@ -54,10 +54,8 @@ static const char sccsid[] = "@(#)unexpand.c 8.1 (Berkeley) 6/6/93";
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <wchar.h>
-#include <wctype.h>
int all;
int nstops;
diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c
index a5e25985260f..783909ec38fc 100644
--- a/usr.bin/usbhidaction/usbhidaction.c
+++ b/usr.bin/usbhidaction/usbhidaction.c
@@ -50,7 +50,6 @@
#include <usbhid.h>
#include <syslog.h>
#include <signal.h>
-#include <errno.h>
#include <sys/stat.h>
static int verbose = 0;
diff --git a/usr.bin/vis/foldit.c b/usr.bin/vis/foldit.c
index 6ad82c2dc2f4..fcf604735607 100644
--- a/usr.bin/vis/foldit.c
+++ b/usr.bin/vis/foldit.c
@@ -41,12 +41,8 @@ static const char sccsid[] = "@(#)foldit.c 8.1 (Berkeley) 6/6/93";
#include <stdio.h>
-#include "extern.h"
-
int
-foldit(chunk, col, max)
- char *chunk;
- int col, max;
+foldit(char *chunk, int col, int max)
{
char *cp;
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index acf6f8c987bd..b46fe17189ee 100644
--- a/usr.bin/w/pr_time.c
+++ b/usr.bin/w/pr_time.c
@@ -43,7 +43,6 @@ static const char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
#include <sys/time.h>
#include <stdio.h>
-#include <string.h>
#include <wchar.h>
#include "extern.h"
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index d35892ed4024..23fce288b086 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -66,7 +66,6 @@ static const char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#include <arpa/inet.h>
#include <arpa/nameser.h>
-#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -82,11 +81,9 @@ static const char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <timeconv.h>
#define _ULOG_POSIX_NAMES
#include <ulog.h>
#include <unistd.h>
-#include <vis.h>
#include "extern.h"
diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c
index a977875942ab..bb5c43e7a9c9 100644
--- a/usr.bin/wall/ttymsg.c
+++ b/usr.bin/wall/ttymsg.c
@@ -48,7 +48,6 @@ static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93";
#include <signal.h>
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
#include <unistd.h>
#include "ttymsg.h"
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index 5db4f8835983..a279d1436885 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <timeconv.h>
#define _ULOG_POSIX_NAMES
#include <ulog.h>
#include <unistd.h>
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 49e47c65a362..35f6a60cfb4b 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/wait.h>
-#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -86,16 +85,16 @@ int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose;
mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
const char *suffix = BACKUP_SUFFIX;
-void copy(int, const char *, int, const char *, off_t);
-int compare(int, const char *, size_t, int, const char *, size_t);
-int create_newfile(const char *, int, struct stat *);
-int create_tempfile(const char *, char *, size_t);
-void install(const char *, const char *, u_long, u_int);
-void install_dir(char *);
-u_long numeric_id(const char *, const char *);
-void strip(const char *);
-int trymmap(int);
-void usage(void);
+static void copy(int, const char *, int, const char *, off_t);
+static int compare(int, const char *, size_t, int, const char *, size_t);
+static int create_newfile(const char *, int, struct stat *);
+static int create_tempfile(const char *, char *, size_t);
+static void install(const char *, const char *, u_long, u_int);
+static void install_dir(char *);
+static u_long numeric_id(const char *, const char *);
+static void strip(const char *);
+static int trymmap(int);
+static void usage(void);
int
main(int argc, char *argv[])
diff --git a/usr.bin/ypcat/ypcat.c b/usr.bin/ypcat/ypcat.c
index 3484bc9c1f4c..3da854e1fbe1 100644
--- a/usr.bin/ypcat/ypcat.c
+++ b/usr.bin/ypcat/ypcat.c
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
-#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/ypmatch/ypmatch.c b/usr.bin/ypmatch/ypmatch.c
index a9c32ea72c48..707a9e93c2f1 100644
--- a/usr.bin/ypmatch/ypmatch.c
+++ b/usr.bin/ypmatch/ypmatch.c
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
-#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c
index 4e719dffcd0e..cb43f64d30a3 100644
--- a/usr.bin/ypwhich/ypwhich.c
+++ b/usr.bin/ypwhich/ypwhich.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <arpa/inet.h>
-#include <ctype.h>
#include <err.h>
#include <netdb.h>
#include <stdio.h>