aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:00:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:00:54 +0000
commit68404f13d4bf4826e3609703dad5375763db28ab (patch)
treeb89ed41daeb3a761ac9416a6eed090023b23e7e2
parenta55bd05f3cea6c7cbfb45d15009cb70570c2a43b (diff)
downloadbusybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.tar.gz
busybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.tar.bz2
busybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.zip
*: add -Wunused-parameter; fix resulting breakage
function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
-rw-r--r--Makefile.flags1
-rw-r--r--archival/bbunzip.c8
-rw-r--r--archival/dpkg.c4
-rw-r--r--console-tools/clear.c2
-rw-r--r--console-tools/loadfont.c2
-rw-r--r--console-tools/loadkmap.c2
-rw-r--r--console-tools/reset.c2
-rw-r--r--console-tools/resize.c4
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/catv.c2
-rw-r--r--coreutils/chmod.c2
-rw-r--r--coreutils/chown.c4
-rw-r--r--coreutils/comm.c2
-rw-r--r--coreutils/cut.c2
-rw-r--r--coreutils/du.c2
-rw-r--r--coreutils/echo.c2
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/expand.c2
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/libcoreutils/coreutils.h2
-rw-r--r--coreutils/libcoreutils/getopt_mk_fifo_nod.c2
-rw-r--r--coreutils/mkfifo.c4
-rw-r--r--coreutils/mknod.c2
-rw-r--r--coreutils/pwd.c2
-rw-r--r--coreutils/readlink.c2
-rw-r--r--coreutils/rm.c2
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sort.c2
-rw-r--r--coreutils/split.c2
-rw-r--r--coreutils/sync.c3
-rw-r--r--coreutils/tac.c2
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/true.c2
-rw-r--r--coreutils/tty.c8
-rw-r--r--coreutils/uniq.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/wc.c2
-rw-r--r--coreutils/who.c2
-rw-r--r--coreutils/whoami.c2
-rw-r--r--debianutils/mktemp.c2
-rw-r--r--debianutils/pipe_progress.c2
-rw-r--r--debianutils/run_parts.c4
-rw-r--r--e2fsprogs/chattr.c2
-rw-r--r--e2fsprogs/fsck.c2
-rw-r--r--e2fsprogs/lsattr.c4
-rw-r--r--editors/cmp.c2
-rw-r--r--editors/diff.c2
-rw-r--r--editors/patch.c2
-rw-r--r--editors/sed.c6
-rw-r--r--editors/vi.c6
-rw-r--r--findutils/find.c4
-rw-r--r--findutils/grep.c2
-rw-r--r--include/busybox.h4
-rw-r--r--include/libbb.h2
-rw-r--r--ipsvd/tcpudp.c4
-rw-r--r--libbb/appletlib.c7
-rw-r--r--libbb/procps.c4
-rw-r--r--libbb/recursive_action.c6
-rw-r--r--loginutils/adduser.c2
-rw-r--r--loginutils/chpasswd.c2
-rw-r--r--loginutils/cryptpw.c2
-rw-r--r--loginutils/getty.c12
-rw-r--r--loginutils/login.c7
-rw-r--r--loginutils/passwd.c2
-rw-r--r--loginutils/sulogin.c2
-rw-r--r--loginutils/vlock.c6
-rw-r--r--miscutils/chat.c2
-rw-r--r--miscutils/crond.c2
-rw-r--r--miscutils/crontab.c2
-rw-r--r--miscutils/eject.c2
-rw-r--r--miscutils/last.c2
-rw-r--r--miscutils/microcom.c2
-rw-r--r--miscutils/strings.c2
-rw-r--r--modutils/insmod.c23
-rw-r--r--modutils/lsmod.c2
-rw-r--r--networking/arp.c2
-rw-r--r--networking/arping.c2
-rw-r--r--networking/dnsd.c9
-rw-r--r--networking/ftpgetput.c2
-rw-r--r--networking/httpd.c4
-rw-r--r--networking/ifenslave.c2
-rw-r--r--networking/ifupdown.c2
-rw-r--r--networking/inetd.c4
-rw-r--r--networking/interface.c2
-rw-r--r--networking/ip.c12
-rw-r--r--networking/isrv_identd.c4
-rw-r--r--networking/libiproute/ll_map.c4
-rw-r--r--networking/nc_bloaty.c2
-rw-r--r--networking/netstat.c2
-rw-r--r--networking/ping.c8
-rw-r--r--networking/pscan.c2
-rw-r--r--networking/route.c6
-rw-r--r--networking/sendmail.c2
-rw-r--r--networking/slattach.c4
-rw-r--r--networking/telnetd.c4
-rw-r--r--networking/tftp.c2
-rw-r--r--networking/udhcp/dhcpc.c2
-rw-r--r--networking/udhcp/dhcpd.c2
-rw-r--r--networking/udhcp/dumpleases.c2
-rw-r--r--networking/wget.c2
-rw-r--r--printutils/lpd.c2
-rw-r--r--printutils/lpr.c2
-rw-r--r--procps/fuser.c2
-rw-r--r--procps/nmeter.c18
-rw-r--r--procps/pgrep.c2
-rw-r--r--procps/pidof.c2
-rw-r--r--procps/ps.c2
-rw-r--r--procps/renice.c2
-rw-r--r--procps/sysctl.c2
-rw-r--r--procps/top.c2
-rw-r--r--procps/uptime.c2
-rw-r--r--procps/watch.c2
-rw-r--r--runit/chpst.c10
-rw-r--r--runit/runsv.c6
-rw-r--r--runit/runsvdir.c6
-rw-r--r--runit/sv.c2
-rw-r--r--runit/svlogd.c8
-rw-r--r--shell/ash.c153
-rw-r--r--shell/hush.c24
-rw-r--r--shell/msh.c46
-rw-r--r--sysklogd/klogd.c2
-rw-r--r--sysklogd/logread.c2
-rw-r--r--sysklogd/syslogd.c2
-rw-r--r--util-linux/dmesg.c2
-rw-r--r--util-linux/fsck_minix.c2
-rw-r--r--util-linux/hwclock.c2
-rw-r--r--util-linux/ipcs.c2
-rw-r--r--util-linux/mdev.c12
-rw-r--r--util-linux/mkfs_minix.c4
-rw-r--r--util-linux/more.c4
-rw-r--r--util-linux/mount.c2
-rw-r--r--util-linux/rdate.c4
-rw-r--r--util-linux/readprofile.c2
-rw-r--r--util-linux/rtcwake.c2
-rw-r--r--util-linux/script.c6
-rw-r--r--util-linux/switch_root.c2
-rw-r--r--util-linux/umount.c2
138 files changed, 352 insertions, 327 deletions
diff --git a/Makefile.flags b/Makefile.flags
index 26552222d..61bff4f66 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -20,6 +20,7 @@ CPPFLAGS += \
20# flag checks are grouped together to speed the checks up a bit.. 20# flag checks are grouped together to speed the checks up a bit..
21CFLAGS += $(call cc-option,-Wall -Wshadow -Wwrite-strings,) 21CFLAGS += $(call cc-option,-Wall -Wshadow -Wwrite-strings,)
22CFLAGS += $(call cc-option,-Wundef -Wstrict-prototypes,) 22CFLAGS += $(call cc-option,-Wundef -Wstrict-prototypes,)
23CFLAGS += $(call cc-option,-Wunused -Wunused-parameter,)
23# If you want to add "-Wmissing-prototypes -Wmissing-declarations" above 24# If you want to add "-Wmissing-prototypes -Wmissing-declarations" above
24# (or anything else for that matter) make sure that it is still possible 25# (or anything else for that matter) make sure that it is still possible
25# to build bbox without warnings. Current offender: find.c:alloc_action(). 26# to build bbox without warnings. Current offender: find.c:alloc_action().
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index b467f1b19..327b3cf2c 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -159,7 +159,7 @@ USE_DESKTOP(long long) int unpack_bunzip2(void)
159} 159}
160 160
161int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 161int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
162int bunzip2_main(int argc, char **argv) 162int bunzip2_main(int argc ATTRIBUTE_UNUSED, char **argv)
163{ 163{
164 getopt32(argv, "cfvdt"); 164 getopt32(argv, "cfvdt");
165 argv += optind; 165 argv += optind;
@@ -257,7 +257,7 @@ USE_DESKTOP(long long) int unpack_gunzip(void)
257} 257}
258 258
259int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 259int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
260int gunzip_main(int argc, char **argv) 260int gunzip_main(int argc ATTRIBUTE_UNUSED, char **argv)
261{ 261{
262 getopt32(argv, "cfvdt"); 262 getopt32(argv, "cfvdt");
263 argv += optind; 263 argv += optind;
@@ -295,7 +295,7 @@ USE_DESKTOP(long long) int unpack_unlzma(void)
295} 295}
296 296
297int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 297int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
298int unlzma_main(int argc, char **argv) 298int unlzma_main(int argc ATTRIBUTE_UNUSED, char **argv)
299{ 299{
300 getopt32(argv, "cf"); 300 getopt32(argv, "cf");
301 argv += optind; 301 argv += optind;
@@ -337,7 +337,7 @@ USE_DESKTOP(long long) int unpack_uncompress(void)
337} 337}
338 338
339int uncompress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 339int uncompress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
340int uncompress_main(int argc, char **argv) 340int uncompress_main(int argc ATTRIBUTE_UNUSED, char **argv)
341{ 341{
342 getopt32(argv, "cf"); 342 getopt32(argv, "cf");
343 argv += optind; 343 argv += optind;
diff --git a/archival/dpkg.c b/archival/dpkg.c
index e90e82b64..7693342f7 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -949,7 +949,7 @@ static int package_satisfies_dependency(int package, int depend_type)
949 return 0; 949 return 0;
950} 950}
951 951
952static int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count) 952static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count - ?? */)
953{ 953{
954 int *conflicts = NULL; 954 int *conflicts = NULL;
955 int conflicts_num = 0; 955 int conflicts_num = 0;
@@ -1689,7 +1689,7 @@ int dpkg_main(int argc, char **argv)
1689 1689
1690 /* Check that the deb file arguments are installable */ 1690 /* Check that the deb file arguments are installable */
1691 if (!(opt & OPT_force_ignore_depends)) { 1691 if (!(opt & OPT_force_ignore_depends)) {
1692 if (!check_deps(deb_file, 0, deb_count)) { 1692 if (!check_deps(deb_file, 0 /*, deb_count*/)) {
1693 bb_error_msg_and_die("dependency check failed"); 1693 bb_error_msg_and_die("dependency check failed");
1694 } 1694 }
1695 } 1695 }
diff --git a/console-tools/clear.c b/console-tools/clear.c
index 769ce3121..0d94e35b8 100644
--- a/console-tools/clear.c
+++ b/console-tools/clear.c
@@ -13,7 +13,7 @@
13#include "libbb.h" 13#include "libbb.h"
14 14
15int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int clear_main(int argc, char **argv) 16int clear_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
17{ 17{
18 return printf("\033[H\033[J") != 6; 18 return printf("\033[H\033[J") != 6;
19} 19}
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 882b8817a..843f4b035 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -167,7 +167,7 @@ static void loadnewfont(int fd)
167} 167}
168 168
169int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 169int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
170int loadfont_main(int argc, char **argv) 170int loadfont_main(int argc, char **argv ATTRIBUTE_UNUSED)
171{ 171{
172 int fd; 172 int fd;
173 173
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 40885ee0c..bea5a771f 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -26,7 +26,7 @@ struct kbentry {
26#define MAX_NR_KEYMAPS 256 26#define MAX_NR_KEYMAPS 256
27 27
28int loadkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28int loadkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29int loadkmap_main(int argc, char **argv) 29int loadkmap_main(int argc, char **argv ATTRIBUTE_UNUSED)
30{ 30{
31 struct kbentry ke; 31 struct kbentry ke;
32 int i, j, fd; 32 int i, j, fd;
diff --git a/console-tools/reset.c b/console-tools/reset.c
index bc18cd050..f36ef544c 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -18,7 +18,7 @@ int stty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18#endif 18#endif
19 19
20int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 20int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
21int reset_main(int argc, char **argv) 21int reset_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
22{ 22{
23 static const char *const args[] = { 23 static const char *const args[] = {
24 "stty", "sane", NULL 24 "stty", "sane", NULL
diff --git a/console-tools/resize.c b/console-tools/resize.c
index 7f72b9a46..01b1442f6 100644
--- a/console-tools/resize.c
+++ b/console-tools/resize.c
@@ -21,10 +21,10 @@ onintr(int sig ATTRIBUTE_UNUSED)
21} 21}
22 22
23int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 23int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
24int resize_main(int argc, char **argv) 24int resize_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
25{ 25{
26 struct termios new; 26 struct termios new;
27 struct winsize w = { 0,0,0,0 }; 27 struct winsize w = { 0, 0, 0, 0 };
28 int ret; 28 int ret;
29 29
30 /* We use _stderr_ in order to make resize usable 30 /* We use _stderr_ in order to make resize usable
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 18a74b81d..181d96a2c 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -44,7 +44,7 @@ int bb_cat(char **argv)
44} 44}
45 45
46int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 46int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
47int cat_main(int argc, char **argv) 47int cat_main(int argc ATTRIBUTE_UNUSED, char **argv)
48{ 48{
49 getopt32(argv, "u"); 49 getopt32(argv, "u");
50 argv += optind; 50 argv += optind;
diff --git a/coreutils/catv.c b/coreutils/catv.c
index 5f5f1bf86..a5ee534e2 100644
--- a/coreutils/catv.c
+++ b/coreutils/catv.c
@@ -13,7 +13,7 @@
13#include "libbb.h" 13#include "libbb.h"
14 14
15int catv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int catv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int catv_main(int argc, char **argv) 16int catv_main(int argc ATTRIBUTE_UNUSED, char **argv)
17{ 17{
18 int retval = EXIT_SUCCESS; 18 int retval = EXIT_SUCCESS;
19 int fd; 19 int fd;
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index a58e4f8e1..1bd0bd5c2 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -68,7 +68,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i
68} 68}
69 69
70int chmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 70int chmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
71int chmod_main(int argc, char **argv) 71int chmod_main(int argc ATTRIBUTE_UNUSED, char **argv)
72{ 72{
73 int retval = EXIT_SUCCESS; 73 int retval = EXIT_SUCCESS;
74 char *arg, **argp; 74 char *arg, **argp;
diff --git a/coreutils/chown.c b/coreutils/chown.c
index df3b77dac..eaaefaf29 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -42,7 +42,7 @@ typedef int (*chown_fptr)(const char *, uid_t, gid_t);
42static struct bb_uidgid_t ugid = { -1, -1 }; 42static struct bb_uidgid_t ugid = { -1, -1 };
43 43
44static int fileAction(const char *fileName, struct stat *statbuf, 44static int fileAction(const char *fileName, struct stat *statbuf,
45 void *cf, int depth) 45 void *cf, int depth ATTRIBUTE_UNUSED)
46{ 46{
47 uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid; 47 uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid;
48 gid_t g = (ugid.gid == (gid_t)-1) ? statbuf->st_gid : ugid.gid; 48 gid_t g = (ugid.gid == (gid_t)-1) ? statbuf->st_gid : ugid.gid;
@@ -62,7 +62,7 @@ static int fileAction(const char *fileName, struct stat *statbuf,
62} 62}
63 63
64int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 64int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
65int chown_main(int argc, char **argv) 65int chown_main(int argc ATTRIBUTE_UNUSED, char **argv)
66{ 66{
67 int retval = EXIT_SUCCESS; 67 int retval = EXIT_SUCCESS;
68 int flags; 68 int flags;
diff --git a/coreutils/comm.c b/coreutils/comm.c
index 67088e06c..4dbc0d477 100644
--- a/coreutils/comm.c
+++ b/coreutils/comm.c
@@ -36,7 +36,7 @@ static void writeline(char *line, int class, int flags)
36} 36}
37 37
38int comm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 38int comm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
39int comm_main(int argc, char **argv) 39int comm_main(int argc ATTRIBUTE_UNUSED, char **argv)
40{ 40{
41#define LINE_LEN 100 41#define LINE_LEN 100
42#define BB_EOF_0 0x1 42#define BB_EOF_0 0x1
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 4f0bed3e7..ed6f8f608 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -162,7 +162,7 @@ static void cut_file(FILE *file, char delim)
162} 162}
163 163
164int cut_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 164int cut_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
165int cut_main(int argc, char **argv) 165int cut_main(int argc ATTRIBUTE_UNUSED, char **argv)
166{ 166{
167 char delim = '\t'; /* delimiter, default is tab */ 167 char delim = '\t'; /* delimiter, default is tab */
168 char *sopt, *ltok; 168 char *sopt, *ltok;
diff --git a/coreutils/du.c b/coreutils/du.c
index 3941151e1..7495f7a7b 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -141,7 +141,7 @@ static unsigned long du(const char *filename)
141} 141}
142 142
143int du_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 143int du_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
144int du_main(int argc, char **argv) 144int du_main(int argc ATTRIBUTE_UNUSED, char **argv)
145{ 145{
146 unsigned long total; 146 unsigned long total;
147 int slink_depth_save; 147 int slink_depth_save;
diff --git a/coreutils/echo.c b/coreutils/echo.c
index 771f610b0..fd6c950ea 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -31,7 +31,7 @@
31 * using call -> jump optimization */ 31 * using call -> jump optimization */
32 32
33int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 33int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
34int echo_main(int argc, char **argv) 34int echo_main(int argc ATTRIBUTE_UNUSED, char **argv)
35{ 35{
36 const char *arg; 36 const char *arg;
37#if !ENABLE_FEATURE_FANCY_ECHO 37#if !ENABLE_FEATURE_FANCY_ECHO
diff --git a/coreutils/env.c b/coreutils/env.c
index 7273d39fc..f678565eb 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -40,7 +40,7 @@ static const char env_longopts[] ALIGN1 =
40#endif 40#endif
41 41
42int env_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 42int env_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
43int env_main(int argc, char **argv) 43int env_main(int argc ATTRIBUTE_UNUSED, char **argv)
44{ 44{
45 /* cleanenv was static - why? */ 45 /* cleanenv was static - why? */
46 char *cleanenv[1]; 46 char *cleanenv[1];
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 96a74a336..c0133956f 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -126,7 +126,7 @@ static void unexpand(FILE *file, unsigned int tab_size, unsigned opt)
126#endif 126#endif
127 127
128int expand_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 128int expand_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
129int expand_main(int argc, char **argv) 129int expand_main(int argc ATTRIBUTE_UNUSED, char **argv)
130{ 130{
131 /* Default 8 spaces for 1 tab */ 131 /* Default 8 spaces for 1 tab */
132 const char *opt_t = "8"; 132 const char *opt_t = "8";
diff --git a/coreutils/id.c b/coreutils/id.c
index 7dba80284..9afb10088 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -37,7 +37,7 @@ static int printf_full(unsigned int id, const char *arg, const char prefix)
37} 37}
38 38
39int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 39int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
40int id_main(int argc, char **argv) 40int id_main(int argc ATTRIBUTE_UNUSED, char **argv)
41{ 41{
42 struct passwd *p; 42 struct passwd *p;
43 uid_t uid; 43 uid_t uid;
diff --git a/coreutils/libcoreutils/coreutils.h b/coreutils/libcoreutils/coreutils.h
index 687c7cc5c..c1796b381 100644
--- a/coreutils/libcoreutils/coreutils.h
+++ b/coreutils/libcoreutils/coreutils.h
@@ -11,6 +11,6 @@ typedef int (*stat_func)(const char *fn, struct stat *ps);
11int cp_mv_stat2(const char *fn, struct stat *fn_stat, stat_func sf); 11int cp_mv_stat2(const char *fn, struct stat *fn_stat, stat_func sf);
12int cp_mv_stat(const char *fn, struct stat *fn_stat); 12int cp_mv_stat(const char *fn, struct stat *fn_stat);
13 13
14mode_t getopt_mk_fifo_nod(int argc, char **argv); 14mode_t getopt_mk_fifo_nod(char **argv);
15 15
16#endif 16#endif
diff --git a/coreutils/libcoreutils/getopt_mk_fifo_nod.c b/coreutils/libcoreutils/getopt_mk_fifo_nod.c
index 377621568..32e55a56b 100644
--- a/coreutils/libcoreutils/getopt_mk_fifo_nod.c
+++ b/coreutils/libcoreutils/getopt_mk_fifo_nod.c
@@ -23,7 +23,7 @@
23#include "libbb.h" 23#include "libbb.h"
24#include "coreutils.h" 24#include "coreutils.h"
25 25
26mode_t getopt_mk_fifo_nod(int argc, char **argv) 26mode_t getopt_mk_fifo_nod(char **argv)
27{ 27{
28 mode_t mode = 0666; 28 mode_t mode = 0666;
29 char *smode = NULL; 29 char *smode = NULL;
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index d298adae0..d9261b96a 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -14,12 +14,12 @@
14#include "libcoreutils/coreutils.h" 14#include "libcoreutils/coreutils.h"
15 15
16int mkfifo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int mkfifo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int mkfifo_main(int argc, char **argv) 17int mkfifo_main(int argc ATTRIBUTE_UNUSED, char **argv)
18{ 18{
19 mode_t mode; 19 mode_t mode;
20 int retval = EXIT_SUCCESS; 20 int retval = EXIT_SUCCESS;
21 21
22 mode = getopt_mk_fifo_nod(argc, argv); 22 mode = getopt_mk_fifo_nod(argv);
23 23
24 argv += optind; 24 argv += optind;
25 if (!*argv) { 25 if (!*argv) {
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index 55f531033..0c694948e 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -24,7 +24,7 @@ int mknod_main(int argc, char **argv)
24 dev_t dev; 24 dev_t dev;
25 const char *name; 25 const char *name;
26 26
27 mode = getopt_mk_fifo_nod(argc, argv); 27 mode = getopt_mk_fifo_nod(argv);
28 argv += optind; 28 argv += optind;
29 argc -= optind; 29 argc -= optind;
30 30
diff --git a/coreutils/pwd.c b/coreutils/pwd.c
index ac604db97..9279dbee6 100644
--- a/coreutils/pwd.c
+++ b/coreutils/pwd.c
@@ -12,7 +12,7 @@
12/* This is a NOFORK applet. Be very careful! */ 12/* This is a NOFORK applet. Be very careful! */
13 13
14int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 14int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15int pwd_main(int argc, char **argv) 15int pwd_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
16{ 16{
17 char *buf; 17 char *buf;
18 18
diff --git a/coreutils/readlink.c b/coreutils/readlink.c
index 1ab94595a..3f13a3660 100644
--- a/coreutils/readlink.c
+++ b/coreutils/readlink.c
@@ -11,7 +11,7 @@
11#include "libbb.h" 11#include "libbb.h"
12 12
13int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 13int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
14int readlink_main(int argc, char **argv) 14int readlink_main(int argc ATTRIBUTE_UNUSED, char **argv)
15{ 15{
16 char *buf; 16 char *buf;
17 char *fname; 17 char *fname;
diff --git a/coreutils/rm.c b/coreutils/rm.c
index a123156d2..1774ce296 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -20,7 +20,7 @@
20/* This is a NOFORK applet. Be very careful! */ 20/* This is a NOFORK applet. Be very careful! */
21 21
22int rm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 22int rm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
23int rm_main(int argc, char **argv) 23int rm_main(int argc ATTRIBUTE_UNUSED, char **argv)
24{ 24{
25 int status = 0; 25 int status = 0;
26 int flags = 0; 26 int flags = 0;
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 96bee231b..cb6046617 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -19,7 +19,7 @@
19#define IGNORE_NON_EMPTY 0x02 19#define IGNORE_NON_EMPTY 0x02
20 20
21int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 21int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
22int rmdir_main(int argc, char **argv) 22int rmdir_main(int argc ATTRIBUTE_UNUSED, char **argv)
23{ 23{
24 int status = EXIT_SUCCESS; 24 int status = EXIT_SUCCESS;
25 int flags; 25 int flags;
diff --git a/coreutils/sort.c b/coreutils/sort.c
index d8df4c532..510f7a235 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -275,7 +275,7 @@ static unsigned str2u(char **str)
275#endif 275#endif
276 276
277int sort_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 277int sort_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
278int sort_main(int argc, char **argv) 278int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
279{ 279{
280 FILE *fp, *outfile = stdout; 280 FILE *fp, *outfile = stdout;
281 char *line, **lines = NULL; 281 char *line, **lines = NULL;
diff --git a/coreutils/split.c b/coreutils/split.c
index 895a04b06..cf26a9322 100644
--- a/coreutils/split.c
+++ b/coreutils/split.c
@@ -56,7 +56,7 @@ enum { READ_BUFFER_SIZE = COMMON_BUFSIZE - 1 };
56#define SPLIT_OPT_a (1<<2) 56#define SPLIT_OPT_a (1<<2)
57 57
58int split_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 58int split_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
59int split_main(int argc, char **argv) 59int split_main(int argc ATTRIBUTE_UNUSED, char **argv)
60{ 60{
61 unsigned suffix_len = 2; 61 unsigned suffix_len = 2;
62 char *pfx; 62 char *pfx;
diff --git a/coreutils/sync.c b/coreutils/sync.c
index 9dbdd98aa..5c9d0926f 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -14,8 +14,9 @@
14/* This is a NOFORK applet. Be very careful! */ 14/* This is a NOFORK applet. Be very careful! */
15 15
16int sync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int sync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int sync_main(int argc, char **argv) 17int sync_main(int argc, char **argv ATTRIBUTE_UNUSED)
18{ 18{
19 /* coreutils-6.9 compat */
19 bb_warn_ignoring_args(argc - 1); 20 bb_warn_ignoring_args(argc - 1);
20 21
21 sync(); 22 sync();
diff --git a/coreutils/tac.c b/coreutils/tac.c
index 7951be255..ddadcc7bc 100644
--- a/coreutils/tac.c
+++ b/coreutils/tac.c
@@ -26,7 +26,7 @@ struct lstring {
26}; 26};
27 27
28int tac_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28int tac_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29int tac_main(int argc, char **argv) 29int tac_main(int argc ATTRIBUTE_UNUSED, char **argv)
30{ 30{
31 char **name; 31 char **name;
32 FILE *f; 32 FILE *f;
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 3fe8b64ad..0b58179e7 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -22,7 +22,7 @@
22/* This is a NOFORK applet. Be very careful! */ 22/* This is a NOFORK applet. Be very careful! */
23 23
24int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 24int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
25int touch_main(int argc, char **argv) 25int touch_main(int argc ATTRIBUTE_UNUSED, char **argv)
26{ 26{
27 int fd; 27 int fd;
28 int status = EXIT_SUCCESS; 28 int status = EXIT_SUCCESS;
diff --git a/coreutils/tr.c b/coreutils/tr.c
index a28ab465e..d0af63a36 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -174,7 +174,7 @@ static int complement(char *buffer, int buffer_len)
174} 174}
175 175
176int tr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 176int tr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
177int tr_main(int argc, char **argv) 177int tr_main(int argc ATTRIBUTE_UNUSED, char **argv)
178{ 178{
179 int output_length = 0, input_length; 179 int output_length = 0, input_length;
180 int i; 180 int i;
diff --git a/coreutils/true.c b/coreutils/true.c
index 2b5919320..565e68b83 100644
--- a/coreutils/true.c
+++ b/coreutils/true.c
@@ -15,7 +15,7 @@
15/* This is a NOFORK applet. Be very careful! */ 15/* This is a NOFORK applet. Be very careful! */
16 16
17int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18int true_main(int argc, char **argv) 18int true_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
19{ 19{
20 return EXIT_SUCCESS; 20 return EXIT_SUCCESS;
21} 21}
diff --git a/coreutils/tty.c b/coreutils/tty.c
index b0a50ff61..48e15117c 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -13,7 +13,7 @@
13#include "libbb.h" 13#include "libbb.h"
14 14
15int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int tty_main(int argc, char **argv) 16int tty_main(int argc, char **argv SKIP_INCLUDE_SUSv2(ATTRIBUTE_UNUSED))
17{ 17{
18 const char *s; 18 const char *s;
19 USE_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */ 19 USE_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */
@@ -22,15 +22,17 @@ int tty_main(int argc, char **argv)
22 xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */ 22 xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */
23 23
24 USE_INCLUDE_SUSv2(silent = getopt32(argv, "s");) 24 USE_INCLUDE_SUSv2(silent = getopt32(argv, "s");)
25 USE_INCLUDE_SUSv2(argc -= optind;)
26 SKIP_INCLUDE_SUSv2(argc -= 1;)
25 27
26 /* gnu tty outputs a warning that it is ignoring all args. */ 28 /* gnu tty outputs a warning that it is ignoring all args. */
27 bb_warn_ignoring_args(argc - optind); 29 bb_warn_ignoring_args(argc);
28 30
29 retval = 0; 31 retval = 0;
30 32
31 s = ttyname(0); 33 s = ttyname(0);
32 if (s == NULL) { 34 if (s == NULL) {
33 /* According to SUSv3, ttyname can on fail with EBADF or ENOTTY. 35 /* According to SUSv3, ttyname can fail with EBADF or ENOTTY.
34 * We know the file descriptor is good, so failure means not a tty. */ 36 * We know the file descriptor is good, so failure means not a tty. */
35 s = "not a tty"; 37 s = "not a tty";
36 retval = 1; 38 retval = 1;
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index cda1e61a9..d0729607c 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -28,7 +28,7 @@ static FILE *xgetoptfile_uniq_s(char **argv, int read0write2)
28} 28}
29 29
30int uniq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 30int uniq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
31int uniq_main(int argc, char **argv) 31int uniq_main(int argc ATTRIBUTE_UNUSED, char **argv)
32{ 32{
33 FILE *in, *out; 33 FILE *in, *out;
34 unsigned long dups, skip_fields, skip_chars, i; 34 unsigned long dups, skip_fields, skip_chars, i;
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 46836624c..34a22398c 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -127,7 +127,7 @@ static void read_base64(FILE *src_stream, FILE *dst_stream)
127} 127}
128 128
129int uudecode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 129int uudecode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
130int uudecode_main(int argc, char **argv) 130int uudecode_main(int argc ATTRIBUTE_UNUSED, char **argv)
131{ 131{
132 FILE *src_stream = stdin; 132 FILE *src_stream = stdin;
133 char *outname = NULL; 133 char *outname = NULL;
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 58ea1c7db..de3c895bd 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -69,7 +69,7 @@ enum {
69}; 69};
70 70
71int wc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 71int wc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
72int wc_main(int argc, char **argv) 72int wc_main(int argc ATTRIBUTE_UNUSED, char **argv)
73{ 73{
74 FILE *fp; 74 FILE *fp;
75 const char *s, *arg; 75 const char *s, *arg;
diff --git a/coreutils/who.c b/coreutils/who.c
index e6bd0afa8..a206ec54b 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -41,7 +41,7 @@ static void idle_string(char *str6, time_t t)
41} 41}
42 42
43int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 43int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
44int who_main(int argc, char **argv) 44int who_main(int argc ATTRIBUTE_UNUSED, char **argv)
45{ 45{
46 char str6[6]; 46 char str6[6];
47 struct utmp *ut; 47 struct utmp *ut;
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index e2fdfc955..d35572ece 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -14,7 +14,7 @@
14/* This is a NOFORK applet. Be very careful! */ 14/* This is a NOFORK applet. Be very careful! */
15 15
16int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int whoami_main(int argc, char **argv) 17int whoami_main(int argc, char **argv ATTRIBUTE_UNUSED)
18{ 18{
19 if (argc > 1) 19 if (argc > 1)
20 bb_show_usage(); 20 bb_show_usage();
diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c
index 7ed624526..b011fc10c 100644
--- a/debianutils/mktemp.c
+++ b/debianutils/mktemp.c
@@ -12,7 +12,7 @@
12#include "libbb.h" 12#include "libbb.h"
13 13
14int mktemp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 14int mktemp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15int mktemp_main(int argc, char **argv) 15int mktemp_main(int argc ATTRIBUTE_UNUSED, char **argv)
16{ 16{
17 // -d Make a directory instead of a file 17 // -d Make a directory instead of a file
18 // -q Fail silently if an error occurs [bbox: ignored] 18 // -q Fail silently if an error occurs [bbox: ignored]
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c
index 4bfdf6aa4..cbdd38ff4 100644
--- a/debianutils/pipe_progress.c
+++ b/debianutils/pipe_progress.c
@@ -15,7 +15,7 @@
15 * Activity is indicated by a '.' to stderr 15 * Activity is indicated by a '.' to stderr
16 */ 16 */
17int pipe_progress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int pipe_progress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18int pipe_progress_main(int argc, char **argv) 18int pipe_progress_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
19{ 19{
20 RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE); 20 RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE);
21 time_t t = time(NULL); 21 time_t t = time(NULL);
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index 20f8b3ab8..2adad026d 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -79,7 +79,7 @@ static int bb_alphasort(const void *p1, const void *p2)
79 return (option_mask32 & OPT_r) ? -r : r; 79 return (option_mask32 & OPT_r) ? -r : r;
80} 80}
81 81
82static int act(const char *file, struct stat *statbuf, void *args, int depth) 82static int act(const char *file, struct stat *statbuf, void *args ATTRIBUTE_UNUSED, int depth)
83{ 83{
84 if (depth == 1) 84 if (depth == 1)
85 return TRUE; 85 return TRUE;
@@ -113,7 +113,7 @@ static const char runparts_longopts[] ALIGN1 =
113#endif 113#endif
114 114
115int run_parts_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 115int run_parts_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
116int run_parts_main(int argc, char **argv) 116int run_parts_main(int argc ATTRIBUTE_UNUSED, char **argv)
117{ 117{
118 const char *umask_p = "22"; 118 const char *umask_p = "22";
119 llist_t *arg_list = NULL; 119 llist_t *arg_list = NULL;
diff --git a/e2fsprogs/chattr.c b/e2fsprogs/chattr.c
index 0f19af8e4..e783d3e89 100644
--- a/e2fsprogs/chattr.c
+++ b/e2fsprogs/chattr.c
@@ -125,7 +125,7 @@ static void change_attributes(const char *name, struct globals *gp)
125} 125}
126 126
127int chattr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 127int chattr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
128int chattr_main(int argc, char **argv) 128int chattr_main(int argc ATTRIBUTE_UNUSED, char **argv)
129{ 129{
130 struct globals g; 130 struct globals g;
131 char *arg; 131 char *arg;
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 6769a7237..178792f6f 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -1128,7 +1128,7 @@ static void signal_cancel(int sig ATTRIBUTE_UNUSED)
1128} 1128}
1129 1129
1130int fsck_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1130int fsck_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1131int fsck_main(int argc, char **argv) 1131int fsck_main(int argc ATTRIBUTE_UNUSED, char **argv)
1132{ 1132{
1133 int i, status; 1133 int i, status;
1134 /*int interactive;*/ 1134 /*int interactive;*/
diff --git a/e2fsprogs/lsattr.c b/e2fsprogs/lsattr.c
index a11f2437b..c58948698 100644
--- a/e2fsprogs/lsattr.c
+++ b/e2fsprogs/lsattr.c
@@ -58,7 +58,7 @@ static void list_attributes(const char *name)
58} 58}
59 59
60static int lsattr_dir_proc(const char *dir_name, struct dirent *de, 60static int lsattr_dir_proc(const char *dir_name, struct dirent *de,
61 void *private) 61 void *private ATTRIBUTE_UNUSED)
62{ 62{
63 struct stat st; 63 struct stat st;
64 char *path; 64 char *path;
@@ -96,7 +96,7 @@ static void lsattr_args(const char *name)
96} 96}
97 97
98int lsattr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 98int lsattr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
99int lsattr_main(int argc, char **argv) 99int lsattr_main(int argc ATTRIBUTE_UNUSED, char **argv)
100{ 100{
101 getopt32(argv, "Radlv"); 101 getopt32(argv, "Radlv");
102 argv += optind; 102 argv += optind;
diff --git a/editors/cmp.c b/editors/cmp.c
index 6dfe0401b..9189b3150 100644
--- a/editors/cmp.c
+++ b/editors/cmp.c
@@ -43,7 +43,7 @@ static const char opt_chars[] ALIGN1 = "sl";
43#define CMP_OPT_l (1<<1) 43#define CMP_OPT_l (1<<1)
44 44
45int cmp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 45int cmp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
46int cmp_main(int argc, char **argv) 46int cmp_main(int argc ATTRIBUTE_UNUSED, char **argv)
47{ 47{
48 FILE *fp1, *fp2, *outfile = stdout; 48 FILE *fp1, *fp2, *outfile = stdout;
49 const char *filename1, *filename2 = "-"; 49 const char *filename1, *filename2 = "-";
diff --git a/editors/diff.c b/editors/diff.c
index 1359af838..f9e82ba02 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -1205,7 +1205,7 @@ static void diffdir(char *p1, char *p2)
1205 1205
1206 1206
1207int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1207int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1208int diff_main(int argc, char **argv) 1208int diff_main(int argc ATTRIBUTE_UNUSED, char **argv)
1209{ 1209{
1210 bool gotstdin = 0; 1210 bool gotstdin = 0;
1211 char *U_opt; 1211 char *U_opt;
diff --git a/editors/patch.c b/editors/patch.c
index 1b283a133..ff1a01d2e 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -78,7 +78,7 @@ static int file_doesnt_exist(const char *filename)
78} 78}
79 79
80int patch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 80int patch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
81int patch_main(int argc, char **argv) 81int patch_main(int argc ATTRIBUTE_UNUSED, char **argv)
82{ 82{
83 int patch_level = -1; 83 int patch_level = -1;
84 char *patch_line; 84 char *patch_line;
diff --git a/editors/sed.c b/editors/sed.c
index c2b9e94b6..a0994aec0 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -301,7 +301,7 @@ static int get_address(const char *my_str, int *linenum, regex_t ** regex)
301} 301}
302 302
303/* Grab a filename. Whitespace at start is skipped, then goes to EOL. */ 303/* Grab a filename. Whitespace at start is skipped, then goes to EOL. */
304static int parse_file_cmd(sed_cmd_t *sed_cmd, const char *filecmdstr, char **retval) 304static int parse_file_cmd(/*sed_cmd_t *sed_cmd,*/ const char *filecmdstr, char **retval)
305{ 305{
306 int start = 0, idx, hack = 0; 306 int start = 0, idx, hack = 0;
307 307
@@ -375,7 +375,7 @@ static int parse_subst_cmd(sed_cmd_t *sed_cmd, const char *substr)
375 case 'w': 375 case 'w':
376 { 376 {
377 char *temp; 377 char *temp;
378 idx += parse_file_cmd(sed_cmd, substr+idx, &temp); 378 idx += parse_file_cmd(/*sed_cmd,*/ substr+idx, &temp);
379 break; 379 break;
380 } 380 }
381 /* Ignore case (gnu exension) */ 381 /* Ignore case (gnu exension) */
@@ -436,7 +436,7 @@ static const char *parse_cmd_args(sed_cmd_t *sed_cmd, const char *cmdstr)
436 } else if (strchr("rw", sed_cmd->cmd)) { 436 } else if (strchr("rw", sed_cmd->cmd)) {
437 if (sed_cmd->end_line || sed_cmd->end_match) 437 if (sed_cmd->end_line || sed_cmd->end_match)
438 bb_error_msg_and_die("command only uses one address"); 438 bb_error_msg_and_die("command only uses one address");
439 cmdstr += parse_file_cmd(sed_cmd, cmdstr, &sed_cmd->string); 439 cmdstr += parse_file_cmd(/*sed_cmd,*/ cmdstr, &sed_cmd->string);
440 if (sed_cmd->cmd == 'w') { 440 if (sed_cmd->cmd == 'w') {
441 sed_cmd->sw_file = xfopen(sed_cmd->string, "w"); 441 sed_cmd->sw_file = xfopen(sed_cmd->string, "w");
442 sed_cmd->sw_last_char = '\n'; 442 sed_cmd->sw_last_char = '\n';
diff --git a/editors/vi.c b/editors/vi.c
index 572e04972..c2d4457e9 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -301,7 +301,7 @@ static void status_line_bold(const char *, ...);
301static void not_implemented(const char *); // display "Not implemented" message 301static void not_implemented(const char *); // display "Not implemented" message
302static int format_edit_status(void); // format file status on status line 302static int format_edit_status(void); // format file status on status line
303static void redraw(int); // force a full screen refresh 303static void redraw(int); // force a full screen refresh
304static char* format_line(char*, int); 304static char* format_line(char* /*, int*/);
305static void refresh(int); // update the terminal from screen[] 305static void refresh(int); // update the terminal from screen[]
306 306
307static void Indicate_Error(void); // use flash or beep to indicate error 307static void Indicate_Error(void); // use flash or beep to indicate error
@@ -2764,7 +2764,7 @@ static void redraw(int full_screen)
2764} 2764}
2765 2765
2766//----- Format a text[] line into a buffer --------------------- 2766//----- Format a text[] line into a buffer ---------------------
2767static char* format_line(char *src, int li) 2767static char* format_line(char *src /*, int li*/)
2768{ 2768{
2769 unsigned char c; 2769 unsigned char c;
2770 int co; 2770 int co;
@@ -2848,7 +2848,7 @@ static void refresh(int full_screen)
2848 int cs, ce; // column start & end 2848 int cs, ce; // column start & end
2849 char *out_buf; 2849 char *out_buf;
2850 // format current text line 2850 // format current text line
2851 out_buf = format_line(tp, li); 2851 out_buf = format_line(tp /*, li*/);
2852 2852
2853 // skip to the end of the current text[] line 2853 // skip to the end of the current text[] line
2854 if (tp < end) { 2854 if (tp < end) {
diff --git a/findutils/find.c b/findutils/find.c
index 8c0397798..50c790161 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -74,7 +74,9 @@ typedef struct {
74#endif 74#endif
75} action; 75} action;
76#define ACTS(name, arg...) typedef struct { action a; arg; } action_##name; 76#define ACTS(name, arg...) typedef struct { action a; arg; } action_##name;
77#define ACTF(name) static int func_##name(const char *fileName, struct stat *statbuf, action_##name* ap) 77#define ACTF(name) static int func_##name(const char *fileName ATTRIBUTE_UNUSED, \
78 struct stat *statbuf ATTRIBUTE_UNUSED, \
79 action_##name* ap ATTRIBUTE_UNUSED)
78 ACTS(print) 80 ACTS(print)
79 ACTS(name, const char *pattern; bool iname;) 81 ACTS(name, const char *pattern; bool iname;)
80USE_FEATURE_FIND_PATH( ACTS(path, const char *pattern;)) 82USE_FEATURE_FIND_PATH( ACTS(path, const char *pattern;))
diff --git a/findutils/grep.c b/findutils/grep.c
index 1094dcc63..c4cfcb852 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -371,7 +371,7 @@ static void load_regexes_from_file(llist_t *fopt)
371 } 371 }
372} 372}
373 373
374static int file_action_grep(const char *filename, struct stat *statbuf, void* matched, int depth) 374static int file_action_grep(const char *filename, struct stat *statbuf ATTRIBUTE_UNUSED, void* matched, int depth ATTRIBUTE_UNUSED)
375{ 375{
376 FILE *file = fopen(filename, "r"); 376 FILE *file = fopen(filename, "r");
377 if (file == NULL) { 377 if (file == NULL) {
diff --git a/include/busybox.h b/include/busybox.h
index ec6953e87..52720244b 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -59,7 +59,9 @@ extern const uint8_t applet_install_loc[];
59/* Length of these names has effect on size of libbusybox 59/* Length of these names has effect on size of libbusybox
60 * and "individual" binaries. Keep them short. 60 * and "individual" binaries. Keep them short.
61 */ 61 */
62void lbb_prepare(const char *applet, char **argv) MAIN_EXTERNALLY_VISIBLE; 62void lbb_prepare(const char *applet
63 USE_FEATURE_INDIVIDUAL(, char **argv)
64 ) MAIN_EXTERNALLY_VISIBLE;
63#if ENABLE_BUILD_LIBBUSYBOX 65#if ENABLE_BUILD_LIBBUSYBOX
64#if ENABLE_FEATURE_SHARED_BUSYBOX 66#if ENABLE_FEATURE_SHARED_BUSYBOX
65int lbb_main(int argc, char **argv) EXTERNALLY_VISIBLE; 67int lbb_main(int argc, char **argv) EXTERNALLY_VISIBLE;
diff --git a/include/libbb.h b/include/libbb.h
index 09deba671..ee1ef518e 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1120,7 +1120,7 @@ enum {
1120 | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME 1120 | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
1121 | PSSCAN_TTY, 1121 | PSSCAN_TTY,
1122}; 1122};
1123procps_status_t* alloc_procps_scan(int flags); 1123//procps_status_t* alloc_procps_scan(void);
1124void free_procps_scan(procps_status_t* sp); 1124void free_procps_scan(procps_status_t* sp);
1125procps_status_t* procps_scan(procps_status_t* sp, int flags); 1125procps_status_t* procps_scan(procps_status_t* sp, int flags);
1126/* Format cmdline (up to col chars) into char buf[col+1] */ 1126/* Format cmdline (up to col chars) into char buf[col+1] */
diff --git a/ipsvd/tcpudp.c b/ipsvd/tcpudp.c
index 2e8dffa0f..8f23ca640 100644
--- a/ipsvd/tcpudp.c
+++ b/ipsvd/tcpudp.c
@@ -143,7 +143,7 @@ static void connection_status(void)
143 bb_error_msg("status %u/%u", cnum, cmax); 143 bb_error_msg("status %u/%u", cnum, cmax);
144} 144}
145 145
146static void sig_child_handler(int sig) 146static void sig_child_handler(int sig ATTRIBUTE_UNUSED)
147{ 147{
148 int wstat; 148 int wstat;
149 int pid; 149 int pid;
@@ -161,7 +161,7 @@ static void sig_child_handler(int sig)
161} 161}
162 162
163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 163int tcpudpsvd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
164int tcpudpsvd_main(int argc, char **argv) 164int tcpudpsvd_main(int argc ATTRIBUTE_UNUSED, char **argv)
165{ 165{
166 char *str_c, *str_C, *str_b, *str_t; 166 char *str_c, *str_C, *str_b, *str_t;
167 char *user; 167 char *user;
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index fec99c5ce..de27dd80e 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -123,7 +123,8 @@ int find_applet_by_name(const char *name)
123int *const bb_errno __attribute__ ((section (".data"))); 123int *const bb_errno __attribute__ ((section (".data")));
124#endif 124#endif
125 125
126void lbb_prepare(const char *applet, char **argv) 126void lbb_prepare(const char *applet
127 USE_FEATURE_INDIVIDUAL(, char **argv))
127{ 128{
128#ifdef __GLIBC__ 129#ifdef __GLIBC__
129 (*(int **)&bb_errno) = __errno_location(); 130 (*(int **)&bb_errno) = __errno_location();
@@ -662,10 +663,10 @@ void run_applet_and_exit(const char *name, char **argv)
662#if ENABLE_BUILD_LIBBUSYBOX 663#if ENABLE_BUILD_LIBBUSYBOX
663int lbb_main(int argc, char **argv) 664int lbb_main(int argc, char **argv)
664#else 665#else
665int main(int argc, char **argv) 666int main(int argc ATTRIBUTE_UNUSED, char **argv)
666#endif 667#endif
667{ 668{
668 lbb_prepare("busybox", argv); 669 lbb_prepare("busybox" USE_FEATURE_INDIVIDUAL(, argv));
669 670
670#if !BB_MMU 671#if !BB_MMU
671 /* NOMMU re-exec trick sets high-order bit in first byte of name */ 672 /* NOMMU re-exec trick sets high-order bit in first byte of name */
diff --git a/libbb/procps.c b/libbb/procps.c
index 015ad80ef..f67f7dcde 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -93,7 +93,7 @@ static int read_to_buf(const char *filename, void *buf)
93 return ret; 93 return ret;
94} 94}
95 95
96procps_status_t *alloc_procps_scan(int flags) 96static procps_status_t *alloc_procps_scan(void)
97{ 97{
98 unsigned n = getpagesize(); 98 unsigned n = getpagesize();
99 procps_status_t* sp = xzalloc(sizeof(procps_status_t)); 99 procps_status_t* sp = xzalloc(sizeof(procps_status_t));
@@ -175,7 +175,7 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
175 struct stat sb; 175 struct stat sb;
176 176
177 if (!sp) 177 if (!sp)
178 sp = alloc_procps_scan(flags); 178 sp = alloc_procps_scan();
179 179
180 for (;;) { 180 for (;;) {
181 entry = readdir(sp->dir); 181 entry = readdir(sp->dir);
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index 37363bb3e..513aff315 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -22,8 +22,10 @@
22 * is so stinking huge. 22 * is so stinking huge.
23 */ 23 */
24 24
25static int true_action(const char *fileName, struct stat *statbuf, 25static int true_action(const char *fileName ATTRIBUTE_UNUSED,
26 void* userData, int depth) 26 struct stat *statbuf ATTRIBUTE_UNUSED,
27 void* userData ATTRIBUTE_UNUSED,
28 int depth ATTRIBUTE_UNUSED)
27{ 29{
28 return TRUE; 30 return TRUE;
29} 31}
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 7b5283e99..d409eabb9 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -85,7 +85,7 @@ static const char adduser_longopts[] ALIGN1 =
85 * can be customized via command-line parameters. 85 * can be customized via command-line parameters.
86 */ 86 */
87int adduser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 87int adduser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
88int adduser_main(int argc, char **argv) 88int adduser_main(int argc ATTRIBUTE_UNUSED, char **argv)
89{ 89{
90 struct passwd pw; 90 struct passwd pw;
91 const char *usegroup = NULL; 91 const char *usegroup = NULL;
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index 7d47899fe..83e5e0c1f 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -21,7 +21,7 @@ static const char chpasswd_longopts[] ALIGN1 =
21#define OPT_MD5 2 21#define OPT_MD5 2
22 22
23int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 23int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
24int chpasswd_main(int argc, char **argv) 24int chpasswd_main(int argc ATTRIBUTE_UNUSED, char **argv)
25{ 25{
26 char *name, *pass; 26 char *name, *pass;
27 char salt[sizeof("$N$XXXXXXXX")]; 27 char salt[sizeof("$N$XXXXXXXX")];
diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c
index 06817a681..c5170c6a4 100644
--- a/loginutils/cryptpw.c
+++ b/loginutils/cryptpw.c
@@ -8,7 +8,7 @@
8#include "libbb.h" 8#include "libbb.h"
9 9
10int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 10int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
11int cryptpw_main(int argc, char **argv) 11int cryptpw_main(int argc ATTRIBUTE_UNUSED, char **argv)
12{ 12{
13 char salt[sizeof("$N$XXXXXXXX")]; 13 char salt[sizeof("$N$XXXXXXXX")];
14 14
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 246bb4711..c8c54e3b9 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -367,7 +367,7 @@ static void auto_baud(char *buf, unsigned size_buf, struct termios *tp)
367} 367}
368 368
369/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */ 369/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
370static void do_prompt(struct options *op, struct termios *tp) 370static void do_prompt(struct options *op)
371{ 371{
372#ifdef ISSUE 372#ifdef ISSUE
373 print_login_issue(op->issue, op->tty); 373 print_login_issue(op->issue, op->tty);
@@ -390,7 +390,7 @@ static int all_is_upcase(const char *s)
390/* get_logname - get user name, establish parity, speed, erase, kill, eol; 390/* get_logname - get user name, establish parity, speed, erase, kill, eol;
391 * return NULL on BREAK, logname on success */ 391 * return NULL on BREAK, logname on success */
392static char *get_logname(char *logname, unsigned size_logname, 392static char *get_logname(char *logname, unsigned size_logname,
393 struct options *op, struct chardata *cp, struct termios *tp) 393 struct options *op, struct chardata *cp)
394{ 394{
395 char *bp; 395 char *bp;
396 char c; /* input character, full eight bits */ 396 char c; /* input character, full eight bits */
@@ -414,7 +414,7 @@ static char *get_logname(char *logname, unsigned size_logname,
414 logname[0] = '\0'; 414 logname[0] = '\0';
415 while (!logname[0]) { 415 while (!logname[0]) {
416 /* Write issue file and prompt, with "parity" bit == 0. */ 416 /* Write issue file and prompt, with "parity" bit == 0. */
417 do_prompt(op, tp); 417 do_prompt(op);
418 418
419 /* Read name, watch for break, parity, erase, kill, end-of-line. */ 419 /* Read name, watch for break, parity, erase, kill, end-of-line. */
420 bp = logname; 420 bp = logname;
@@ -621,7 +621,7 @@ static void update_utmp(const char *line, char *fakehost)
621#endif /* CONFIG_FEATURE_UTMP */ 621#endif /* CONFIG_FEATURE_UTMP */
622 622
623int getty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 623int getty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
624int getty_main(int argc, char **argv) 624int getty_main(int argc ATTRIBUTE_UNUSED, char **argv)
625{ 625{
626 int n; 626 int n;
627 char *fakehost = NULL; /* Fake hostname for ut_host */ 627 char *fakehost = NULL; /* Fake hostname for ut_host */
@@ -670,7 +670,7 @@ int getty_main(int argc, char **argv)
670 670
671#ifdef DEBUGGING 671#ifdef DEBUGGING
672 dbf = xfopen(DEBUGTERM, "w"); 672 dbf = xfopen(DEBUGTERM, "w");
673 for (n = 1; n < argc; n++) { 673 for (n = 1; argv[n]; n++) {
674 debug(argv[n]); 674 debug(argv[n]);
675 debug("\n"); 675 debug("\n");
676 } 676 }
@@ -750,7 +750,7 @@ int getty_main(int argc, char **argv)
750 /* Read the login name. */ 750 /* Read the login name. */
751 debug("reading login name\n"); 751 debug("reading login name\n");
752 logname = get_logname(line_buf, sizeof(line_buf), 752 logname = get_logname(line_buf, sizeof(line_buf),
753 &options, &chardata, &termios); 753 &options, &chardata);
754 if (logname) 754 if (logname)
755 break; 755 break;
756 /* we are here only if options.numspeed > 1 */ 756 /* we are here only if options.numspeed > 1 */
diff --git a/loginutils/login.c b/loginutils/login.c
index a3caa0fca..79e7494bf 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -114,7 +114,7 @@ static void write_utent(struct utmp *utptr, const char *username)
114#endif /* !ENABLE_FEATURE_UTMP */ 114#endif /* !ENABLE_FEATURE_UTMP */
115 115
116#if ENABLE_FEATURE_NOLOGIN 116#if ENABLE_FEATURE_NOLOGIN
117static void die_if_nologin_and_non_root(int amroot) 117static void die_if_nologin(void)
118{ 118{
119 FILE *fp; 119 FILE *fp;
120 int c; 120 int c;
@@ -135,7 +135,7 @@ static void die_if_nologin_and_non_root(int amroot)
135 puts("\r\n[Disconnect bypassed -- root login allowed]\r"); 135 puts("\r\n[Disconnect bypassed -- root login allowed]\r");
136} 136}
137#else 137#else
138static ALWAYS_INLINE void die_if_nologin_and_non_root(int amroot) {} 138static ALWAYS_INLINE void die_if_nologin(void) {}
139#endif 139#endif
140 140
141#if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM 141#if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM
@@ -406,7 +406,8 @@ int login_main(int argc, char **argv)
406 } 406 }
407 407
408 alarm(0); 408 alarm(0);
409 die_if_nologin_and_non_root(pw->pw_uid == 0); 409 if (!amroot)
410 die_if_nologin();
410 411
411 write_utent(&utent, username); 412 write_utent(&utent, username);
412 413
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 2f85e9f21..3353db1fa 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -70,7 +70,7 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo)
70} 70}
71 71
72int passwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 72int passwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
73int passwd_main(int argc, char **argv) 73int passwd_main(int argc ATTRIBUTE_UNUSED, char **argv)
74{ 74{
75 enum { 75 enum {
76 OPT_algo = 0x1, /* -a - password algorithm */ 76 OPT_algo = 0x1, /* -a - password algorithm */
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 3a1a8e9f5..caa1a8335 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -15,7 +15,7 @@
15 15
16 16
17int sulogin_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int sulogin_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18int sulogin_main(int argc, char **argv) 18int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv)
19{ 19{
20 char *cp; 20 char *cp;
21 int timeout = 0; 21 int timeout = 0;
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index ff60d78ff..96c1f679a 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -18,21 +18,21 @@
18#include <sys/vt.h> 18#include <sys/vt.h>
19#include "libbb.h" 19#include "libbb.h"
20 20
21static void release_vt(int signo) 21static void release_vt(int signo ATTRIBUTE_UNUSED)
22{ 22{
23 /* If -a, param is 0, which means: 23 /* If -a, param is 0, which means:
24 * "no, kernel, we don't allow console switch away from us!" */ 24 * "no, kernel, we don't allow console switch away from us!" */
25 ioctl(STDIN_FILENO, VT_RELDISP, (unsigned long) !option_mask32); 25 ioctl(STDIN_FILENO, VT_RELDISP, (unsigned long) !option_mask32);
26} 26}
27 27
28static void acquire_vt(int signo) 28static void acquire_vt(int signo ATTRIBUTE_UNUSED)
29{ 29{
30 /* ACK to kernel that switch to console is successful */ 30 /* ACK to kernel that switch to console is successful */
31 ioctl(STDIN_FILENO, VT_RELDISP, VT_ACKACQ); 31 ioctl(STDIN_FILENO, VT_RELDISP, VT_ACKACQ);
32} 32}
33 33
34int vlock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 34int vlock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
35int vlock_main(int argc, char **argv) 35int vlock_main(int argc ATTRIBUTE_UNUSED, char **argv)
36{ 36{
37 struct vt_mode vtm; 37 struct vt_mode vtm;
38 struct termios term; 38 struct termios term;
diff --git a/miscutils/chat.c b/miscutils/chat.c
index 4f55738ec..50c5ad976 100644
--- a/miscutils/chat.c
+++ b/miscutils/chat.c
@@ -103,7 +103,7 @@ static size_t unescape(char *s, int *nocr)
103 103
104 104
105int chat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 105int chat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
106int chat_main(int argc, char **argv) 106int chat_main(int argc ATTRIBUTE_UNUSED, char **argv)
107{ 107{
108// should we dump device output? to what fd? by default no. 108// should we dump device output? to what fd? by default no.
109// this can be controlled later via ECHO {ON|OFF} chat directive 109// this can be controlled later via ECHO {ON|OFF} chat directive
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 6d4825e85..75555c874 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -158,7 +158,7 @@ static void crondlog(const char *ctl, ...)
158} 158}
159 159
160int crond_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 160int crond_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
161int crond_main(int ac, char **av) 161int crond_main(int ac ATTRIBUTE_UNUSED, char **av)
162{ 162{
163 unsigned opt; 163 unsigned opt;
164 164
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index cb261ed18..94d69f032 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -88,7 +88,7 @@ static int open_as_user(const struct passwd *pas, const char *file)
88} 88}
89 89
90int crontab_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 90int crontab_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
91int crontab_main(int argc, char **argv) 91int crontab_main(int argc ATTRIBUTE_UNUSED, char **argv)
92{ 92{
93 const struct passwd *pas; 93 const struct passwd *pas;
94 const char *crontab_dir = CRONTABS; 94 const char *crontab_dir = CRONTABS;
diff --git a/miscutils/eject.c b/miscutils/eject.c
index 746a0184e..3d27ce545 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -79,7 +79,7 @@ static void eject_cdrom(const int fd, const unsigned long flags,
79} 79}
80 80
81int eject_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 81int eject_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
82int eject_main(int argc, char **argv) 82int eject_main(int argc ATTRIBUTE_UNUSED, char **argv)
83{ 83{
84 unsigned long flags; 84 unsigned long flags;
85 const char *device; 85 const char *device;
diff --git a/miscutils/last.c b/miscutils/last.c
index fc5916ec2..f4d9a812e 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -27,7 +27,7 @@
27#endif 27#endif
28 28
29int last_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 29int last_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30int last_main(int argc, char **argv) 30int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
31{ 31{
32 struct utmp ut; 32 struct utmp ut;
33 int n, file = STDIN_FILENO; 33 int n, file = STDIN_FILENO;
diff --git a/miscutils/microcom.c b/miscutils/microcom.c
index 5219335a6..5ce430a03 100644
--- a/miscutils/microcom.c
+++ b/miscutils/microcom.c
@@ -41,7 +41,7 @@ static int xset1(int fd, struct termios *tio, const char *device)
41} 41}
42 42
43int microcom_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 43int microcom_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
44int microcom_main(int argc, char **argv) 44int microcom_main(int argc ATTRIBUTE_UNUSED, char **argv)
45{ 45{
46 int sfd; 46 int sfd;
47 int nfd; 47 int nfd;
diff --git a/miscutils/strings.c b/miscutils/strings.c
index d75beccea..57a2c0a17 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -17,7 +17,7 @@
17#define SIZE 8 17#define SIZE 8
18 18
19int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 19int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
20int strings_main(int argc, char **argv) 20int strings_main(int argc ATTRIBUTE_UNUSED, char **argv)
21{ 21{
22 int n, c, status = EXIT_SUCCESS; 22 int n, c, status = EXIT_SUCCESS;
23 unsigned opt; 23 unsigned opt;
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 4620f6f95..079de6940 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -651,7 +651,7 @@ static struct obj_symbol *arch_new_symbol(void);
651 651
652static enum obj_reloc arch_apply_relocation(struct obj_file *f, 652static enum obj_reloc arch_apply_relocation(struct obj_file *f,
653 struct obj_section *targsec, 653 struct obj_section *targsec,
654 struct obj_section *symsec, 654 /*struct obj_section *symsec,*/
655 struct obj_symbol *sym, 655 struct obj_symbol *sym,
656 ElfW(RelM) *rel, ElfW(Addr) value); 656 ElfW(RelM) *rel, ElfW(Addr) value);
657 657
@@ -792,8 +792,9 @@ static char *m_fullName;
792/*======================================================================*/ 792/*======================================================================*/
793 793
794 794
795static int check_module_name_match(const char *filename, struct stat *statbuf, 795static int check_module_name_match(const char *filename,
796 void *userdata, int depth) 796 struct stat *statbuf ATTRIBUTE_UNUSED,
797 void *userdata, int depth ATTRIBUTE_UNUSED)
797{ 798{
798 char *fullname = (char *) userdata; 799 char *fullname = (char *) userdata;
799 char *tmp; 800 char *tmp;
@@ -835,7 +836,7 @@ static struct obj_symbol *arch_new_symbol(void)
835static enum obj_reloc 836static enum obj_reloc
836arch_apply_relocation(struct obj_file *f, 837arch_apply_relocation(struct obj_file *f,
837 struct obj_section *targsec, 838 struct obj_section *targsec,
838 struct obj_section *symsec, 839 /*struct obj_section *symsec,*/
839 struct obj_symbol *sym, 840 struct obj_symbol *sym,
840 ElfW(RelM) *rel, ElfW(Addr) v) 841 ElfW(RelM) *rel, ElfW(Addr) v)
841{ 842{
@@ -1751,7 +1752,7 @@ static int arch_list_add(ElfW(RelM) *rel, struct arch_list_entry **list,
1751 1752
1752#if defined(USE_SINGLE) 1753#if defined(USE_SINGLE)
1753 1754
1754static int arch_single_init(ElfW(RelM) *rel, struct arch_single_entry *single, 1755static int arch_single_init(/*ElfW(RelM) *rel,*/ struct arch_single_entry *single,
1755 int offset, int size) 1756 int offset, int size)
1756{ 1757{
1757 if (single->allocated == 0) { 1758 if (single->allocated == 0) {
@@ -1899,7 +1900,7 @@ static void arch_create_got(struct obj_file *f)
1899#if defined(USE_GOT_ENTRIES) 1900#if defined(USE_GOT_ENTRIES)
1900 if (got_allocate) { 1901 if (got_allocate) {
1901 got_offset += arch_single_init( 1902 got_offset += arch_single_init(
1902 rel, &intsym->gotent, 1903 /*rel,*/ &intsym->gotent,
1903 got_offset, GOT_ENTRY_SIZE); 1904 got_offset, GOT_ENTRY_SIZE);
1904 1905
1905 got_needed = 1; 1906 got_needed = 1;
@@ -1913,7 +1914,7 @@ static void arch_create_got(struct obj_file *f)
1913 plt_offset, PLT_ENTRY_SIZE); 1914 plt_offset, PLT_ENTRY_SIZE);
1914#else 1915#else
1915 plt_offset += arch_single_init( 1916 plt_offset += arch_single_init(
1916 rel, &intsym->pltent, 1917 /*rel,*/ &intsym->pltent,
1917 plt_offset, PLT_ENTRY_SIZE); 1918 plt_offset, PLT_ENTRY_SIZE);
1918#endif 1919#endif
1919 plt_needed = 1; 1920 plt_needed = 1;
@@ -3220,7 +3221,7 @@ static int obj_relocate(struct obj_file *f, ElfW(Addr) base)
3220 3221
3221 /* Do it! */ 3222 /* Do it! */
3222 switch (arch_apply_relocation 3223 switch (arch_apply_relocation
3223 (f, targsec, symsec, intsym, rel, value) 3224 (f, targsec, /*symsec,*/ intsym, rel, value)
3224 ) { 3225 ) {
3225 case obj_reloc_ok: 3226 case obj_reloc_ok:
3226 break; 3227 break;
@@ -3299,7 +3300,7 @@ static int obj_create_image(struct obj_file *f, char *image)
3299 3300
3300/*======================================================================*/ 3301/*======================================================================*/
3301 3302
3302static struct obj_file *obj_load(FILE * fp, int loadprogbits) 3303static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED)
3303{ 3304{
3304 struct obj_file *f; 3305 struct obj_file *f;
3305 ElfW(Shdr) * section_headers; 3306 ElfW(Shdr) * section_headers;
@@ -4193,9 +4194,9 @@ static const char *moderror(int err)
4193 4194
4194#if !ENABLE_FEATURE_2_4_MODULES 4195#if !ENABLE_FEATURE_2_4_MODULES
4195int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 4196int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
4196int insmod_main(int argc, char **argv) 4197int insmod_main(int argc ATTRIBUTE_UNUSED, char **argv)
4197#else 4198#else
4198static int insmod_ng_main(int argc, char **argv) 4199static int insmod_ng_main(int argc ATTRIBUTE_UNUSED, char **argv)
4199#endif 4200#endif
4200{ 4201{
4201 long ret; 4202 long ret;
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index f1f78ff9f..baf0e2a9d 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -141,7 +141,7 @@ int lsmod_main(int argc, char **argv)
141#else /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */ 141#else /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */
142 142
143int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 143int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
144int lsmod_main(int argc, char **argv) 144int lsmod_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
145{ 145{
146 FILE *file = xfopen("/proc/modules", "r"); 146 FILE *file = xfopen("/proc/modules", "r");
147 147
diff --git a/networking/arp.c b/networking/arp.c
index 36985fc5a..c9b9d1d0d 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -435,7 +435,7 @@ static int arp_show(char *name)
435} 435}
436 436
437int arp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 437int arp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
438int arp_main(int argc, char **argv) 438int arp_main(int argc ATTRIBUTE_UNUSED, char **argv)
439{ 439{
440 char *hw_type; 440 char *hw_type;
441 char *protocol; 441 char *protocol;
diff --git a/networking/arping.c b/networking/arping.c
index 2277ec55e..6a17b18ee 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -245,7 +245,7 @@ static bool recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
245} 245}
246 246
247int arping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 247int arping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
248int arping_main(int argc, char **argv) 248int arping_main(int argc ATTRIBUTE_UNUSED, char **argv)
249{ 249{
250 const char *device = "eth0"; 250 const char *device = "eth0";
251 char *source = NULL; 251 char *source = NULL;
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 0a5278377..b269bc52a 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -321,15 +321,15 @@ static int process_packet(uint8_t * buf)
321/* 321/*
322 * Exit on signal 322 * Exit on signal
323 */ 323 */
324static void interrupt(int x) 324static void interrupt(int sig)
325{ 325{
326 /* unlink("/var/run/dnsd.lock"); */ 326 /* unlink("/var/run/dnsd.lock"); */
327 bb_error_msg("interrupt, exiting\n"); 327 bb_error_msg("interrupt, exiting\n");
328 exit(2); 328 kill_myself_with_sig(sig);
329} 329}
330 330
331int dnsd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 331int dnsd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
332int dnsd_main(int argc, char **argv) 332int dnsd_main(int argc ATTRIBUTE_UNUSED, char **argv)
333{ 333{
334 const char *listen_interface = "0.0.0.0"; 334 const char *listen_interface = "0.0.0.0";
335 char *sttl, *sport; 335 char *sttl, *sport;
@@ -387,6 +387,9 @@ int dnsd_main(int argc, char **argv)
387// Or else we can exhibit usual UDP ugliness: 387// Or else we can exhibit usual UDP ugliness:
388// [ip1.multihomed.ip2] <= query to ip1 <= peer 388// [ip1.multihomed.ip2] <= query to ip1 <= peer
389// [ip1.multihomed.ip2] => reply from ip2 => peer (confused) 389// [ip1.multihomed.ip2] => reply from ip2 => peer (confused)
390
391// TODO: recv_from_to
392
390 r = recvfrom(udps, buf, sizeof(buf), 0, &lsa->u.sa, &fromlen); 393 r = recvfrom(udps, buf, sizeof(buf), 0, &lsa->u.sa, &fromlen);
391 if (OPT_verbose) 394 if (OPT_verbose)
392 bb_info_msg("Got UDP packet"); 395 bb_info_msg("Got UDP packet");
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 91f6fcd0d..6e2d96093 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -297,7 +297,7 @@ static const char ftpgetput_longopts[] ALIGN1 =
297#endif 297#endif
298 298
299int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 299int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
300int ftpgetput_main(int argc, char **argv) 300int ftpgetput_main(int argc ATTRIBUTE_UNUSED, char **argv)
301{ 301{
302 /* content-length of the file */ 302 /* content-length of the file */
303 unsigned opt; 303 unsigned opt;
diff --git a/networking/httpd.c b/networking/httpd.c
index 7b7446ed9..54f288c7a 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1754,7 +1754,7 @@ static Htaccess_Proxy *find_proxy_entry(const char *url)
1754 * Handle timeouts 1754 * Handle timeouts
1755 */ 1755 */
1756static void exit_on_signal(int sig) ATTRIBUTE_NORETURN; 1756static void exit_on_signal(int sig) ATTRIBUTE_NORETURN;
1757static void exit_on_signal(int sig) 1757static void exit_on_signal(int sig ATTRIBUTE_UNUSED)
1758{ 1758{
1759 send_headers_and_exit(HTTP_REQUEST_TIMEOUT); 1759 send_headers_and_exit(HTTP_REQUEST_TIMEOUT);
1760} 1760}
@@ -2275,7 +2275,7 @@ enum {
2275 2275
2276 2276
2277int httpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 2277int httpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
2278int httpd_main(int argc, char **argv) 2278int httpd_main(int argc ATTRIBUTE_UNUSED, char **argv)
2279{ 2279{
2280 int server_socket = server_socket; /* for gcc */ 2280 int server_socket = server_socket; /* for gcc */
2281 unsigned opt; 2281 unsigned opt;
diff --git a/networking/ifenslave.c b/networking/ifenslave.c
index 76aaa7614..1e3d5bb95 100644
--- a/networking/ifenslave.c
+++ b/networking/ifenslave.c
@@ -150,7 +150,7 @@ static int release(char *master_ifname, char *slave_ifname);
150 150
151 151
152int ifenslave_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 152int ifenslave_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
153int ifenslave_main(int argc, char **argv) 153int ifenslave_main(int argc ATTRIBUTE_UNUSED, char **argv)
154{ 154{
155 char *master_ifname, *slave_ifname; 155 char *master_ifname, *slave_ifname;
156 int rv; 156 int rv;
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 58e69530c..6aa929a30 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -530,7 +530,7 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
530#endif 530#endif
531} 531}
532 532
533static int manual_up_down(struct interface_defn_t *ifd, execfn *exec) 533static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED)
534{ 534{
535 return 1; 535 return 1;
536} 536}
diff --git a/networking/inetd.c b/networking/inetd.c
index 41824dbc8..0ddfa6b45 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1128,7 +1128,7 @@ static void clean_up_and_exit(int sig ATTRIBUTE_UNUSED)
1128} 1128}
1129 1129
1130int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1130int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1131int inetd_main(int argc, char **argv) 1131int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
1132{ 1132{
1133 struct sigaction sa, saved_pipe_handler; 1133 struct sigaction sa, saved_pipe_handler;
1134 servtab_t *sep, *sep2; 1134 servtab_t *sep, *sep2;
@@ -1492,7 +1492,7 @@ static void init_ring(void)
1492} 1492}
1493/* Character generator. MMU arches only. */ 1493/* Character generator. MMU arches only. */
1494/* ARGSUSED */ 1494/* ARGSUSED */
1495static void chargen_stream(int s, servtab_t *sep) 1495static void chargen_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
1496{ 1496{
1497 char *rs; 1497 char *rs;
1498 int len; 1498 int len;
diff --git a/networking/interface.c b/networking/interface.c
index 04d12b37e..367d2b0bc 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -237,7 +237,7 @@ static char *UNSPEC_print(unsigned char *ptr)
237} 237}
238 238
239/* Display an UNSPEC socket address. */ 239/* Display an UNSPEC socket address. */
240static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric) 240static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric ATTRIBUTE_UNUSED)
241{ 241{
242 if (sap->sa_family == 0xFFFF || sap->sa_family == 0) 242 if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
243 return "[NONE SET]"; 243 return "[NONE SET]";
diff --git a/networking/ip.c b/networking/ip.c
index 5d9785194..bb409c5ce 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -37,35 +37,35 @@ static int ip_do(int (*ip_func)(char **argv), char **argv)
37 37
38#if ENABLE_FEATURE_IP_ADDRESS 38#if ENABLE_FEATURE_IP_ADDRESS
39int ipaddr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 39int ipaddr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
40int ipaddr_main(int argc, char **argv) 40int ipaddr_main(int argc ATTRIBUTE_UNUSED, char **argv)
41{ 41{
42 return ip_do(do_ipaddr, argv); 42 return ip_do(do_ipaddr, argv);
43} 43}
44#endif 44#endif
45#if ENABLE_FEATURE_IP_LINK 45#if ENABLE_FEATURE_IP_LINK
46int iplink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 46int iplink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
47int iplink_main(int argc, char **argv) 47int iplink_main(int argc ATTRIBUTE_UNUSED, char **argv)
48{ 48{
49 return ip_do(do_iplink, argv); 49 return ip_do(do_iplink, argv);
50} 50}
51#endif 51#endif
52#if ENABLE_FEATURE_IP_ROUTE 52#if ENABLE_FEATURE_IP_ROUTE
53int iproute_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 53int iproute_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
54int iproute_main(int argc, char **argv) 54int iproute_main(int argc ATTRIBUTE_UNUSED, char **argv)
55{ 55{
56 return ip_do(do_iproute, argv); 56 return ip_do(do_iproute, argv);
57} 57}
58#endif 58#endif
59#if ENABLE_FEATURE_IP_RULE 59#if ENABLE_FEATURE_IP_RULE
60int iprule_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 60int iprule_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
61int iprule_main(int argc, char **argv) 61int iprule_main(int argc ATTRIBUTE_UNUSED, char **argv)
62{ 62{
63 return ip_do(do_iprule, argv); 63 return ip_do(do_iprule, argv);
64} 64}
65#endif 65#endif
66#if ENABLE_FEATURE_IP_TUNNEL 66#if ENABLE_FEATURE_IP_TUNNEL
67int iptunnel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 67int iptunnel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
68int iptunnel_main(int argc, char **argv) 68int iptunnel_main(int argc ATTRIBUTE_UNUSED, char **argv)
69{ 69{
70 return ip_do(do_iptunnel, argv); 70 return ip_do(do_iptunnel, argv);
71} 71}
@@ -73,7 +73,7 @@ int iptunnel_main(int argc, char **argv)
73 73
74 74
75int ip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 75int ip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
76int ip_main(int argc, char **argv) 76int ip_main(int argc ATTRIBUTE_UNUSED, char **argv)
77{ 77{
78 static const char keywords[] ALIGN1 = 78 static const char keywords[] ALIGN1 =
79 USE_FEATURE_IP_ADDRESS("address\0") 79 USE_FEATURE_IP_ADDRESS("address\0")
diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c
index 33338572d..d60c9fbaf 100644
--- a/networking/isrv_identd.c
+++ b/networking/isrv_identd.c
@@ -76,7 +76,7 @@ static int do_rd(int fd, void **paramp)
76 return retval; 76 return retval;
77} 77}
78 78
79static int do_timeout(void **paramp) 79static int do_timeout(void **paramp ATTRIBUTE_UNUSED)
80{ 80{
81 return 1; /* terminate session */ 81 return 1; /* terminate session */
82} 82}
@@ -93,7 +93,7 @@ static void inetd_mode(void)
93} 93}
94 94
95int fakeidentd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 95int fakeidentd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
96int fakeidentd_main(int argc, char **argv) 96int fakeidentd_main(int argc ATTRIBUTE_UNUSED, char **argv)
97{ 97{
98 enum { 98 enum {
99 OPT_foreground = 0x1, 99 OPT_foreground = 0x1,
diff --git a/networking/libiproute/ll_map.c b/networking/libiproute/ll_map.c
index 7b5de92c2..3cfc9ccec 100644
--- a/networking/libiproute/ll_map.c
+++ b/networking/libiproute/ll_map.c
@@ -39,7 +39,9 @@ static struct idxmap *find_by_index(int idx)
39 return NULL; 39 return NULL;
40} 40}
41 41
42int ll_remember_index(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) 42int ll_remember_index(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
43 struct nlmsghdr *n,
44 void *arg ATTRIBUTE_UNUSED)
43{ 45{
44 int h; 46 int h;
45 struct ifinfomsg *ifi = NLMSG_DATA(n); 47 struct ifinfomsg *ifi = NLMSG_DATA(n);
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c
index ce4829584..34f715fc5 100644
--- a/networking/nc_bloaty.c
+++ b/networking/nc_bloaty.c
@@ -177,7 +177,7 @@ static void unarm(void)
177} 177}
178 178
179/* timeout and other signal handling cruft */ 179/* timeout and other signal handling cruft */
180static void tmtravel(int sig) 180static void tmtravel(int sig ATTRIBUTE_UNUSED)
181{ 181{
182 unarm(); 182 unarm();
183 longjmp(jbuf, 1); 183 longjmp(jbuf, 1);
diff --git a/networking/netstat.c b/networking/netstat.c
index 399ff9b42..fd8d8ecf3 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -486,7 +486,7 @@ static void do_info(const char *file, const char *name, int (*proc)(int, char *)
486} 486}
487 487
488int netstat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 488int netstat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
489int netstat_main(int argc, char **argv) 489int netstat_main(int argc ATTRIBUTE_UNUSED, char **argv)
490{ 490{
491 const char *net_conn_line_header = PRINT_NET_CONN_HEADER; 491 const char *net_conn_line_header = PRINT_NET_CONN_HEADER;
492 unsigned opt; 492 unsigned opt;
diff --git a/networking/ping.c b/networking/ping.c
index 11138c036..93b2e02f1 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -174,7 +174,7 @@ static void ping6(len_and_sockaddr *lsa)
174#endif 174#endif
175 175
176int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 176int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
177int ping_main(int argc, char **argv) 177int ping_main(int argc ATTRIBUTE_UNUSED, char **argv)
178{ 178{
179 len_and_sockaddr *lsa; 179 len_and_sockaddr *lsa;
180#if ENABLE_PING6 180#if ENABLE_PING6
@@ -495,7 +495,7 @@ static void unpack4(char *buf, int sz, struct sockaddr_in *from)
495 } 495 }
496} 496}
497#if ENABLE_PING6 497#if ENABLE_PING6
498static void unpack6(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit) 498static void unpack6(char *packet, int sz, /*struct sockaddr_in6 *from,*/ int hoplimit)
499{ 499{
500 struct icmp6_hdr *icmppkt; 500 struct icmp6_hdr *icmppkt;
501 char buf[INET6_ADDRSTRLEN]; 501 char buf[INET6_ADDRSTRLEN];
@@ -658,7 +658,7 @@ static void ping6(len_and_sockaddr *lsa)
658 hoplimit = *(int*)CMSG_DATA(mp); 658 hoplimit = *(int*)CMSG_DATA(mp);
659 } 659 }
660 } 660 }
661 unpack6(packet, c, &from, hoplimit); 661 unpack6(packet, c, /*&from,*/ hoplimit);
662 if (pingcount > 0 && nreceived >= pingcount) 662 if (pingcount > 0 && nreceived >= pingcount)
663 break; 663 break;
664 } 664 }
@@ -683,7 +683,7 @@ static void ping(len_and_sockaddr *lsa)
683} 683}
684 684
685int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 685int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
686int ping_main(int argc, char **argv) 686int ping_main(int argc ATTRIBUTE_UNUSED, char **argv)
687{ 687{
688 len_and_sockaddr *lsa; 688 len_and_sockaddr *lsa;
689 char *opt_c, *opt_s; 689 char *opt_c, *opt_s;
diff --git a/networking/pscan.c b/networking/pscan.c
index 830419371..022d21254 100644
--- a/networking/pscan.c
+++ b/networking/pscan.c
@@ -31,7 +31,7 @@ static const char *port_name(unsigned port)
31#define MONOTONIC_US() ((unsigned)monotonic_us()) 31#define MONOTONIC_US() ((unsigned)monotonic_us())
32 32
33int pscan_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 33int pscan_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
34int pscan_main(int argc, char **argv) 34int pscan_main(int argc ATTRIBUTE_UNUSED, char **argv)
35{ 35{
36 const char *opt_max_port = "1024"; /* -P: default max port */ 36 const char *opt_max_port = "1024"; /* -P: default max port */
37 const char *opt_min_port = "1"; /* -p: default min port */ 37 const char *opt_min_port = "1"; /* -p: default min port */
diff --git a/networking/route.c b/networking/route.c
index 6f945b9f8..53e3988c1 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -539,7 +539,7 @@ void bb_displayroutes(int noresolve, int netstatfmt)
539 539
540#if ENABLE_FEATURE_IPV6 540#if ENABLE_FEATURE_IPV6
541 541
542static void INET6_displayroutes(int noresolve) 542static void INET6_displayroutes(void)
543{ 543{
544 char addr6[128], *naddr6; 544 char addr6[128], *naddr6;
545 /* In addr6x, we store both 40-byte ':'-delimited ipv6 addresses. 545 /* In addr6x, we store both 40-byte ':'-delimited ipv6 addresses.
@@ -642,7 +642,7 @@ static const char tbl_verb[] ALIGN1 =
642; 642;
643 643
644int route_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 644int route_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
645int route_main(int argc, char **argv) 645int route_main(int argc ATTRIBUTE_UNUSED, char **argv)
646{ 646{
647 unsigned opt; 647 unsigned opt;
648 int what; 648 int what;
@@ -675,7 +675,7 @@ int route_main(int argc, char **argv)
675 int noresolve = (opt & ROUTE_OPT_n) ? 0x0fff : 0; 675 int noresolve = (opt & ROUTE_OPT_n) ? 0x0fff : 0;
676#if ENABLE_FEATURE_IPV6 676#if ENABLE_FEATURE_IPV6
677 if (opt & ROUTE_OPT_INET6) 677 if (opt & ROUTE_OPT_INET6)
678 INET6_displayroutes(noresolve); 678 INET6_displayroutes();
679 else 679 else
680#endif 680#endif
681 bb_displayroutes(noresolve, opt & ROUTE_OPT_e); 681 bb_displayroutes(noresolve, opt & ROUTE_OPT_e);
diff --git a/networking/sendmail.c b/networking/sendmail.c
index eb356dcf5..241028b92 100644
--- a/networking/sendmail.c
+++ b/networking/sendmail.c
@@ -252,7 +252,7 @@ static void pop3_message(const char *filename)
252#endif 252#endif
253 253
254int sendgetmail_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 254int sendgetmail_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
255int sendgetmail_main(int argc, char **argv) 255int sendgetmail_main(int argc ATTRIBUTE_UNUSED, char **argv)
256{ 256{
257 llist_t *opt_recipients = NULL; 257 llist_t *opt_recipients = NULL;
258 258
diff --git a/networking/slattach.c b/networking/slattach.c
index 1987eb39c..3ffbb3ba8 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -114,13 +114,13 @@ static void set_state(struct termios *state, int encap)
114 } 114 }
115} 115}
116 116
117static void sig_handler(int signo) 117static void sig_handler(int signo ATTRIBUTE_UNUSED)
118{ 118{
119 restore_state_and_exit(0); 119 restore_state_and_exit(0);
120} 120}
121 121
122int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 122int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
123int slattach_main(int argc, char **argv) 123int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv)
124{ 124{
125 /* Line discipline code table */ 125 /* Line discipline code table */
126 static const char proto_names[] ALIGN1 = 126 static const char proto_names[] ALIGN1 =
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 05de49e8a..20c57925f 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -338,7 +338,7 @@ free_session(struct tsession *ts)
338 338
339#endif 339#endif
340 340
341static void handle_sigchld(int sig) 341static void handle_sigchld(int sig ATTRIBUTE_UNUSED)
342{ 342{
343 pid_t pid; 343 pid_t pid;
344 struct tsession *ts; 344 struct tsession *ts;
@@ -360,7 +360,7 @@ static void handle_sigchld(int sig)
360} 360}
361 361
362int telnetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 362int telnetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
363int telnetd_main(int argc, char **argv) 363int telnetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
364{ 364{
365 fd_set rdfdset, wrfdset; 365 fd_set rdfdset, wrfdset;
366 unsigned opt; 366 unsigned opt;
diff --git a/networking/tftp.c b/networking/tftp.c
index 6cad295e3..14c340b22 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -392,7 +392,7 @@ static int tftp( USE_GETPUT(const int cmd,)
392} 392}
393 393
394int tftp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 394int tftp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
395int tftp_main(int argc, char **argv) 395int tftp_main(int argc ATTRIBUTE_UNUSED, char **argv)
396{ 396{
397 len_and_sockaddr *peer_lsa; 397 len_and_sockaddr *peer_lsa;
398 const char *localfile = NULL; 398 const char *localfile = NULL;
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 7fca184ab..576b1cbb8 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -129,7 +129,7 @@ static uint8_t* alloc_dhcp_option(int code, const char *str, int extra)
129 129
130 130
131int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 131int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
132int udhcpc_main(int argc, char **argv) 132int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
133{ 133{
134 uint8_t *temp, *message; 134 uint8_t *temp, *message;
135 char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_A, *str_t; 135 char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_A, *str_t;
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index eb7323da7..263719657 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -23,7 +23,7 @@ struct dhcpOfferedAddr *leases;
23 23
24 24
25int udhcpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 25int udhcpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
26int udhcpd_main(int argc, char **argv) 26int udhcpd_main(int argc ATTRIBUTE_UNUSED, char **argv)
27{ 27{
28 fd_set rfds; 28 fd_set rfds;
29 struct timeval tv; 29 struct timeval tv;
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index 218e6bc57..83b384177 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -8,7 +8,7 @@
8#include "dhcpd.h" 8#include "dhcpd.h"
9 9
10int dumpleases_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 10int dumpleases_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
11int dumpleases_main(int argc, char **argv) 11int dumpleases_main(int argc ATTRIBUTE_UNUSED, char **argv)
12{ 12{
13 int fd; 13 int fd;
14 int i; 14 int i;
diff --git a/networking/wget.c b/networking/wget.c
index a77a2add7..dc1dc2ad9 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -387,7 +387,7 @@ static char *gethdr(char *buf, size_t bufsiz, FILE *fp /*, int *istrunc*/)
387 387
388 388
389int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 389int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
390int wget_main(int argc, char **argv) 390int wget_main(int argc ATTRIBUTE_UNUSED, char **argv)
391{ 391{
392 char buf[512]; 392 char buf[512];
393 struct host_info server, target; 393 struct host_info server, target;
diff --git a/printutils/lpd.c b/printutils/lpd.c
index 916fd6213..49e3fd744 100644
--- a/printutils/lpd.c
+++ b/printutils/lpd.c
@@ -11,7 +11,7 @@
11// TODO: xmalloc_reads is vulnerable to remote OOM attack! 11// TODO: xmalloc_reads is vulnerable to remote OOM attack!
12 12
13int lpd_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE; 13int lpd_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE;
14int lpd_main(int argc, char *argv[]) 14int lpd_main(int argc ATTRIBUTE_UNUSED, char *argv[])
15{ 15{
16 int spooling; 16 int spooling;
17 char *s, *queue; 17 char *s, *queue;
diff --git a/printutils/lpr.c b/printutils/lpr.c
index 153e6ab96..5313d5a20 100644
--- a/printutils/lpr.c
+++ b/printutils/lpr.c
@@ -42,7 +42,7 @@ static void get_response_or_say_and_die(int fd, const char *errmsg)
42} 42}
43 43
44int lpqr_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE; 44int lpqr_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE;
45int lpqr_main(int argc, char *argv[]) 45int lpqr_main(int argc ATTRIBUTE_UNUSED, char *argv[])
46{ 46{
47 enum { 47 enum {
48 OPT_P = 1 << 0, // -P queue[@host[:port]]. If no -P is given use $PRINTER, then "lp@localhost:515" 48 OPT_P = 1 << 0, // -P queue[@host[:port]]. If no -P is given use $PRINTER, then "lp@localhost:515"
diff --git a/procps/fuser.c b/procps/fuser.c
index d625b16ab..48c9bdc1e 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -267,7 +267,7 @@ static int kill_pid_list(pid_list *plist, int sig)
267} 267}
268 268
269int fuser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 269int fuser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
270int fuser_main(int argc, char **argv) 270int fuser_main(int argc ATTRIBUTE_UNUSED, char **argv)
271{ 271{
272 pid_list *plist; 272 pid_list *plist;
273 inode_list *ilist; 273 inode_list *ilist;
diff --git a/procps/nmeter.c b/procps/nmeter.c
index 7ab2865c8..b6e754b7a 100644
--- a/procps/nmeter.c
+++ b/procps/nmeter.c
@@ -275,7 +275,7 @@ typedef struct a { \
275S_STAT(s_stat) 275S_STAT(s_stat)
276S_STAT_END(s_stat) 276S_STAT_END(s_stat)
277 277
278static void collect_literal(s_stat *s) 278static void collect_literal(s_stat *s ATTRIBUTE_UNUSED)
279{ 279{
280} 280}
281 281
@@ -294,7 +294,7 @@ static s_stat* init_delay(const char *param)
294 return NULL; 294 return NULL;
295} 295}
296 296
297static s_stat* init_cr(const char *param) 297static s_stat* init_cr(const char *param ATTRIBUTE_UNUSED)
298{ 298{
299 final_str = "\r"; 299 final_str = "\r";
300 return (s_stat*)0; 300 return (s_stat*)0;
@@ -436,7 +436,7 @@ static void collect_ctx(ctx_stat *s)
436 scale(data[0] - old); 436 scale(data[0] - old);
437} 437}
438 438
439static s_stat* init_ctx(const char *param) 439static s_stat* init_ctx(const char *param ATTRIBUTE_UNUSED)
440{ 440{
441 ctx_stat *s = xmalloc(sizeof(ctx_stat)); 441 ctx_stat *s = xmalloc(sizeof(ctx_stat));
442 s->collect = collect_ctx; 442 s->collect = collect_ctx;
@@ -478,7 +478,7 @@ static void collect_blk(blk_stat *s)
478 scale(data[1]*512); 478 scale(data[1]*512);
479} 479}
480 480
481static s_stat* init_blk(const char *param) 481static s_stat* init_blk(const char *param ATTRIBUTE_UNUSED)
482{ 482{
483 blk_stat *s = xmalloc(sizeof(blk_stat)); 483 blk_stat *s = xmalloc(sizeof(blk_stat));
484 s->collect = collect_blk; 484 s->collect = collect_blk;
@@ -491,7 +491,7 @@ S_STAT(fork_stat)
491 ullong old; 491 ullong old;
492S_STAT_END(fork_stat) 492S_STAT_END(fork_stat)
493 493
494static void collect_thread_nr(fork_stat *s) 494static void collect_thread_nr(fork_stat *s ATTRIBUTE_UNUSED)
495{ 495{
496 ullong data[1]; 496 ullong data[1];
497 497
@@ -660,7 +660,7 @@ static s_stat* init_mem(const char *param)
660S_STAT(swp_stat) 660S_STAT(swp_stat)
661S_STAT_END(swp_stat) 661S_STAT_END(swp_stat)
662 662
663static void collect_swp(swp_stat *s) 663static void collect_swp(swp_stat *s ATTRIBUTE_UNUSED)
664{ 664{
665 ullong s_total[1]; 665 ullong s_total[1];
666 ullong s_free[1]; 666 ullong s_free[1];
@@ -673,7 +673,7 @@ static void collect_swp(swp_stat *s)
673 scale((s_total[0]-s_free[0]) << 10); 673 scale((s_total[0]-s_free[0]) << 10);
674} 674}
675 675
676static s_stat* init_swp(const char *param) 676static s_stat* init_swp(const char *param ATTRIBUTE_UNUSED)
677{ 677{
678 swp_stat *s = xmalloc(sizeof(swp_stat)); 678 swp_stat *s = xmalloc(sizeof(swp_stat));
679 s->collect = collect_swp; 679 s->collect = collect_swp;
@@ -684,7 +684,7 @@ static s_stat* init_swp(const char *param)
684S_STAT(fd_stat) 684S_STAT(fd_stat)
685S_STAT_END(fd_stat) 685S_STAT_END(fd_stat)
686 686
687static void collect_fd(fd_stat *s) 687static void collect_fd(fd_stat *s ATTRIBUTE_UNUSED)
688{ 688{
689 ullong data[2]; 689 ullong data[2];
690 690
@@ -696,7 +696,7 @@ static void collect_fd(fd_stat *s)
696 scale(data[0] - data[1]); 696 scale(data[0] - data[1]);
697} 697}
698 698
699static s_stat* init_fd(const char *param) 699static s_stat* init_fd(const char *param ATTRIBUTE_UNUSED)
700{ 700{
701 fd_stat *s = xmalloc(sizeof(fd_stat)); 701 fd_stat *s = xmalloc(sizeof(fd_stat));
702 s->collect = collect_fd; 702 s->collect = collect_fd;
diff --git a/procps/pgrep.c b/procps/pgrep.c
index e4dfacb54..1ffc87db0 100644
--- a/procps/pgrep.c
+++ b/procps/pgrep.c
@@ -45,7 +45,7 @@ static void act(unsigned pid, char *cmd, int signo, unsigned opt)
45} 45}
46 46
47int pgrep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 47int pgrep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
48int pgrep_main(int argc, char **argv) 48int pgrep_main(int argc ATTRIBUTE_UNUSED, char **argv)
49{ 49{
50 unsigned pid = getpid(); 50 unsigned pid = getpid();
51 int signo = SIGTERM; 51 int signo = SIGTERM;
diff --git a/procps/pidof.c b/procps/pidof.c
index 86d1957a6..46e646d6e 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -17,7 +17,7 @@ enum {
17}; 17};
18 18
19int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 19int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
20int pidof_main(int argc, char **argv) 20int pidof_main(int argc ATTRIBUTE_UNUSED, char **argv)
21{ 21{
22 unsigned first = 1; 22 unsigned first = 1;
23 unsigned opt; 23 unsigned opt;
diff --git a/procps/ps.c b/procps/ps.c
index f9d346ccf..647e03fc4 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -422,7 +422,7 @@ static void format_process(const procps_status_t *ps)
422} 422}
423 423
424int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 424int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
425int ps_main(int argc, char **argv) 425int ps_main(int argc ATTRIBUTE_UNUSED, char **argv)
426{ 426{
427 procps_status_t *p; 427 procps_status_t *p;
428 llist_t* opt_o = NULL; 428 llist_t* opt_o = NULL;
diff --git a/procps/renice.c b/procps/renice.c
index ab0d3a1c4..d2dcf152c 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -27,7 +27,7 @@ void BUG_bad_PRIO_PGRP(void);
27void BUG_bad_PRIO_USER(void); 27void BUG_bad_PRIO_USER(void);
28 28
29int renice_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 29int renice_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30int renice_main(int argc, char **argv) 30int renice_main(int argc ATTRIBUTE_UNUSED, char **argv)
31{ 31{
32 static const char Xetpriority_msg[] ALIGN1 = "%cetpriority"; 32 static const char Xetpriority_msg[] ALIGN1 = "%cetpriority";
33 33
diff --git a/procps/sysctl.c b/procps/sysctl.c
index 3a0af02d2..1995382ad 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -57,7 +57,7 @@ enum {
57}; 57};
58 58
59int sysctl_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 59int sysctl_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
60int sysctl_main(int argc, char **argv) 60int sysctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
61{ 61{
62 int retval; 62 int retval;
63 int opt; 63 int opt;
diff --git a/procps/top.c b/procps/top.c
index f4bb5094a..fdd7584c8 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -735,7 +735,7 @@ enum {
735}; 735};
736 736
737int top_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 737int top_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
738int top_main(int argc, char **argv) 738int top_main(int argc ATTRIBUTE_UNUSED, char **argv)
739{ 739{
740 int count, lines, col; 740 int count, lines, col;
741 unsigned interval; 741 unsigned interval;
diff --git a/procps/uptime.c b/procps/uptime.c
index 07e8d607d..b729055a5 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -26,7 +26,7 @@
26 26
27 27
28int uptime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28int uptime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29int uptime_main(int argc, char **argv) 29int uptime_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
30{ 30{
31 int updays, uphours, upminutes; 31 int updays, uphours, upminutes;
32 struct sysinfo info; 32 struct sysinfo info;
diff --git a/procps/watch.c b/procps/watch.c
index b4955258e..5b774e808 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -24,7 +24,7 @@
24// (procps 3.x and procps 2.x are forks, not newer/older versions of the same) 24// (procps 3.x and procps 2.x are forks, not newer/older versions of the same)
25 25
26int watch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 26int watch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
27int watch_main(int argc, char **argv) 27int watch_main(int argc ATTRIBUTE_UNUSED, char **argv)
28{ 28{
29 unsigned opt; 29 unsigned opt;
30 unsigned period = 2; 30 unsigned period = 2;
diff --git a/runit/chpst.c b/runit/chpst.c
index b306974bb..fcac8ee3c 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -290,7 +290,7 @@ static void envdir(int, char **) ATTRIBUTE_NORETURN;
290static void softlimit(int, char **) ATTRIBUTE_NORETURN; 290static void softlimit(int, char **) ATTRIBUTE_NORETURN;
291 291
292int chpst_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 292int chpst_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
293int chpst_main(int argc, char **argv) 293int chpst_main(int argc ATTRIBUTE_UNUSED, char **argv)
294{ 294{
295 INIT_G(); 295 INIT_G();
296 296
@@ -349,7 +349,7 @@ int chpst_main(int argc, char **argv)
349 bb_perror_msg_and_die("exec %s", argv[0]); 349 bb_perror_msg_and_die("exec %s", argv[0]);
350} 350}
351 351
352static void setuidgid(int argc, char **argv) 352static void setuidgid(int argc ATTRIBUTE_UNUSED, char **argv)
353{ 353{
354 const char *account; 354 const char *account;
355 355
@@ -361,7 +361,7 @@ static void setuidgid(int argc, char **argv)
361 bb_perror_msg_and_die("exec %s", argv[0]); 361 bb_perror_msg_and_die("exec %s", argv[0]);
362} 362}
363 363
364static void envuidgid(int argc, char **argv) 364static void envuidgid(int argc ATTRIBUTE_UNUSED, char **argv)
365{ 365{
366 const char *account; 366 const char *account;
367 367
@@ -373,7 +373,7 @@ static void envuidgid(int argc, char **argv)
373 bb_perror_msg_and_die("exec %s", argv[0]); 373 bb_perror_msg_and_die("exec %s", argv[0]);
374} 374}
375 375
376static void envdir(int argc, char **argv) 376static void envdir(int argc ATTRIBUTE_UNUSED, char **argv)
377{ 377{
378 const char *dir; 378 const char *dir;
379 379
@@ -385,7 +385,7 @@ static void envdir(int argc, char **argv)
385 bb_perror_msg_and_die("exec %s", argv[0]); 385 bb_perror_msg_and_die("exec %s", argv[0]);
386} 386}
387 387
388static void softlimit(int argc, char **argv) 388static void softlimit(int argc ATTRIBUTE_UNUSED, char **argv)
389{ 389{
390 char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t; 390 char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t;
391 getopt32(argv, "+a:c:d:f:l:m:o:p:r:s:t:", 391 getopt32(argv, "+a:c:d:f:l:m:o:p:r:s:t:",
diff --git a/runit/runsv.c b/runit/runsv.c
index 5d4e1584e..0da03e6b3 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -128,12 +128,12 @@ static void warn_cannot(const char *m)
128 bb_perror_msg("%s: warning: cannot %s", dir, m); 128 bb_perror_msg("%s: warning: cannot %s", dir, m);
129} 129}
130 130
131static void s_child(int sig_no) 131static void s_child(int sig_no ATTRIBUTE_UNUSED)
132{ 132{
133 write(selfpipe.wr, "", 1); 133 write(selfpipe.wr, "", 1);
134} 134}
135 135
136static void s_term(int sig_no) 136static void s_term(int sig_no ATTRIBUTE_UNUSED)
137{ 137{
138 sigterm = 1; 138 sigterm = 1;
139 write(selfpipe.wr, "", 1); /* XXX */ 139 write(selfpipe.wr, "", 1); /* XXX */
@@ -432,7 +432,7 @@ static int ctrl(struct svdir *s, char c)
432} 432}
433 433
434int runsv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 434int runsv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
435int runsv_main(int argc, char **argv) 435int runsv_main(int argc ATTRIBUTE_UNUSED, char **argv)
436{ 436{
437 struct stat s; 437 struct stat s;
438 int fd; 438 int fd;
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 0ab672ef4..bca5c901c 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -72,11 +72,11 @@ static void warnx(const char *m1)
72 warn3x(m1, "", ""); 72 warn3x(m1, "", "");
73} 73}
74 74
75static void s_term(int sig_no) 75static void s_term(int sig_no ATTRIBUTE_UNUSED)
76{ 76{
77 exitsoon = 1; 77 exitsoon = 1;
78} 78}
79static void s_hangup(int sig_no) 79static void s_hangup(int sig_no ATTRIBUTE_UNUSED)
80{ 80{
81 exitsoon = 2; 81 exitsoon = 2;
82} 82}
@@ -207,7 +207,7 @@ static int setup_log(void)
207} 207}
208 208
209int runsvdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 209int runsvdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
210int runsvdir_main(int argc, char **argv) 210int runsvdir_main(int argc ATTRIBUTE_UNUSED, char **argv)
211{ 211{
212 struct stat s; 212 struct stat s;
213 dev_t last_dev = last_dev; /* for gcc */ 213 dev_t last_dev = last_dev; /* for gcc */
diff --git a/runit/sv.c b/runit/sv.c
index 141f7a8bc..45d5572f8 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -293,7 +293,7 @@ static unsigned svstatus_print(const char *m)
293 return pid ? 1 : 2; 293 return pid ? 1 : 2;
294} 294}
295 295
296static int status(const char *unused) 296static int status(const char *unused ATTRIBUTE_UNUSED)
297{ 297{
298 int r; 298 int r;
299 299
diff --git a/runit/svlogd.c b/runit/svlogd.c
index c69cb545c..4458bd787 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -783,14 +783,14 @@ static int buffer_pread(/*int fd, */char *s, unsigned len)
783 return i; 783 return i;
784} 784}
785 785
786static void sig_term_handler(int sig_no) 786static void sig_term_handler(int sig_no ATTRIBUTE_UNUSED)
787{ 787{
788 if (verbose) 788 if (verbose)
789 bb_error_msg(INFO"sig%s received", "term"); 789 bb_error_msg(INFO"sig%s received", "term");
790 exitasap = 1; 790 exitasap = 1;
791} 791}
792 792
793static void sig_child_handler(int sig_no) 793static void sig_child_handler(int sig_no ATTRIBUTE_UNUSED)
794{ 794{
795 int pid, l; 795 int pid, l;
796 796
@@ -807,14 +807,14 @@ static void sig_child_handler(int sig_no)
807 } 807 }
808} 808}
809 809
810static void sig_alarm_handler(int sig_no) 810static void sig_alarm_handler(int sig_no ATTRIBUTE_UNUSED)
811{ 811{
812 if (verbose) 812 if (verbose)
813 bb_error_msg(INFO"sig%s received", "alarm"); 813 bb_error_msg(INFO"sig%s received", "alarm");
814 rotateasap = 1; 814 rotateasap = 1;
815} 815}
816 816
817static void sig_hangup_handler(int sig_no) 817static void sig_hangup_handler(int sig_no ATTRIBUTE_UNUSED)
818{ 818{
819 if (verbose) 819 if (verbose)
820 bb_error_msg(INFO"sig%s received", "hangup"); 820 bb_error_msg(INFO"sig%s received", "hangup");
diff --git a/shell/ash.c b/shell/ash.c
index 069909118..580918ceb 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2472,7 +2472,7 @@ docd(const char *dest, int flags)
2472} 2472}
2473 2473
2474static int 2474static int
2475cdcmd(int argc, char **argv) 2475cdcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
2476{ 2476{
2477 const char *dest; 2477 const char *dest;
2478 const char *path; 2478 const char *path;
@@ -2536,7 +2536,7 @@ cdcmd(int argc, char **argv)
2536} 2536}
2537 2537
2538static int 2538static int
2539pwdcmd(int argc, char **argv) 2539pwdcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
2540{ 2540{
2541 int flags; 2541 int flags;
2542 const char *dir = curdir; 2542 const char *dir = curdir;
@@ -3138,19 +3138,20 @@ printalias(const struct alias *ap)
3138 * TODO - sort output 3138 * TODO - sort output
3139 */ 3139 */
3140static int 3140static int
3141aliascmd(int argc, char **argv) 3141aliascmd(int argc ATTRIBUTE_UNUSED, char **argv)
3142{ 3142{
3143 char *n, *v; 3143 char *n, *v;
3144 int ret = 0; 3144 int ret = 0;
3145 struct alias *ap; 3145 struct alias *ap;
3146 3146
3147 if (argc == 1) { 3147 if (!argv[1]) {
3148 int i; 3148 int i;
3149 3149
3150 for (i = 0; i < ATABSIZE; i++) 3150 for (i = 0; i < ATABSIZE; i++) {
3151 for (ap = atab[i]; ap; ap = ap->next) { 3151 for (ap = atab[i]; ap; ap = ap->next) {
3152 printalias(ap); 3152 printalias(ap);
3153 } 3153 }
3154 }
3154 return 0; 3155 return 0;
3155 } 3156 }
3156 while ((n = *++argv) != NULL) { 3157 while ((n = *++argv) != NULL) {
@@ -3172,7 +3173,7 @@ aliascmd(int argc, char **argv)
3172} 3173}
3173 3174
3174static int 3175static int
3175unaliascmd(int argc, char **argv) 3176unaliascmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
3176{ 3177{
3177 int i; 3178 int i;
3178 3179
@@ -3245,7 +3246,7 @@ struct job {
3245static pid_t backgndpid; /* pid of last background process */ 3246static pid_t backgndpid; /* pid of last background process */
3246static smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */ 3247static smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */
3247 3248
3248static struct job *makejob(union node *, int); 3249static struct job *makejob(/*union node *,*/ int);
3249static int forkshell(struct job *, union node *, int); 3250static int forkshell(struct job *, union node *, int);
3250static int waitforjob(struct job *); 3251static int waitforjob(struct job *);
3251 3252
@@ -3612,8 +3613,8 @@ setjobctl(int on)
3612static int 3613static int
3613killcmd(int argc, char **argv) 3614killcmd(int argc, char **argv)
3614{ 3615{
3616 int i = 1;
3615 if (argv[1] && strcmp(argv[1], "-l") != 0) { 3617 if (argv[1] && strcmp(argv[1], "-l") != 0) {
3616 int i = 1;
3617 do { 3618 do {
3618 if (argv[i][0] == '%') { 3619 if (argv[i][0] == '%') {
3619 struct job *jp = getjob(argv[i], 0); 3620 struct job *jp = getjob(argv[i], 0);
@@ -3675,7 +3676,7 @@ restartjob(struct job *jp, int mode)
3675} 3676}
3676 3677
3677static int 3678static int
3678fg_bgcmd(int argc, char **argv) 3679fg_bgcmd(int argc ATTRIBUTE_UNUSED, char **argv)
3679{ 3680{
3680 struct job *jp; 3681 struct job *jp;
3681 FILE *out; 3682 FILE *out;
@@ -3962,7 +3963,7 @@ showjobs(FILE *out, int mode)
3962} 3963}
3963 3964
3964static int 3965static int
3965jobscmd(int argc, char **argv) 3966jobscmd(int argc ATTRIBUTE_UNUSED, char **argv)
3966{ 3967{
3967 int mode, m; 3968 int mode, m;
3968 3969
@@ -4015,7 +4016,7 @@ getstatus(struct job *job)
4015} 4016}
4016 4017
4017static int 4018static int
4018waitcmd(int argc, char **argv) 4019waitcmd(int argc ATTRIBUTE_UNUSED, char **argv)
4019{ 4020{
4020 struct job *job; 4021 struct job *job;
4021 int retval; 4022 int retval;
@@ -4121,7 +4122,7 @@ growjobtab(void)
4121 * Called with interrupts off. 4122 * Called with interrupts off.
4122 */ 4123 */
4123static struct job * 4124static struct job *
4124makejob(union node *node, int nprocs) 4125makejob(/*union node *node,*/ int nprocs)
4125{ 4126{
4126 int i; 4127 int i;
4127 struct job *jp; 4128 struct job *jp;
@@ -4156,7 +4157,7 @@ makejob(union node *node, int nprocs)
4156 if (nprocs > 1) { 4157 if (nprocs > 1) {
4157 jp->ps = ckmalloc(nprocs * sizeof(struct procstat)); 4158 jp->ps = ckmalloc(nprocs * sizeof(struct procstat));
4158 } 4159 }
4159 TRACE(("makejob(0x%lx, %d) returns %%%d\n", (long)node, nprocs, 4160 TRACE(("makejob(%d) returns %%%d\n", nprocs,
4160 jobno(jp))); 4161 jobno(jp)));
4161 return jp; 4162 return jp;
4162} 4163}
@@ -4484,7 +4485,7 @@ static void closescript(void);
4484 4485
4485/* Called after fork(), in child */ 4486/* Called after fork(), in child */
4486static void 4487static void
4487forkchild(struct job *jp, union node *n, int mode) 4488forkchild(struct job *jp, /*union node *n,*/ int mode)
4488{ 4489{
4489 int oldlvl; 4490 int oldlvl;
4490 4491
@@ -4584,7 +4585,7 @@ forkshell(struct job *jp, union node *n, int mode)
4584 ash_msg_and_raise_error("cannot fork"); 4585 ash_msg_and_raise_error("cannot fork");
4585 } 4586 }
4586 if (pid == 0) 4587 if (pid == 0)
4587 forkchild(jp, n, mode); 4588 forkchild(jp, /*n,*/ mode);
4588 else 4589 else
4589 forkparent(jp, n, mode, pid); 4590 forkparent(jp, n, mode, pid);
4590 return pid; 4591 return pid;
@@ -5371,7 +5372,7 @@ evalbackcmd(union node *n, struct backcmd *result)
5371 5372
5372 if (pipe(pip) < 0) 5373 if (pipe(pip) < 0)
5373 ash_msg_and_raise_error("pipe call failed"); 5374 ash_msg_and_raise_error("pipe call failed");
5374 jp = makejob(n, 1); 5375 jp = makejob(/*n,*/ 1);
5375 if (forkshell(jp, n, FORK_NOJOB) == 0) { 5376 if (forkshell(jp, n, FORK_NOJOB) == 0) {
5376 FORCE_INT_ON; 5377 FORCE_INT_ON;
5377 close(pip[0]); 5378 close(pip[0]);
@@ -5668,7 +5669,7 @@ argstr(char *p, int flag, struct strlist *var_str_list)
5668} 5669}
5669 5670
5670static char * 5671static char *
5671scanleft(char *startp, char *rmesc, char *rmescend, char *str, int quotes, 5672scanleft(char *startp, char *rmesc, char *rmescend ATTRIBUTE_UNUSED, char *str, int quotes,
5672 int zero) 5673 int zero)
5673{ 5674{
5674 char *loc; 5675 char *loc;
@@ -6407,7 +6408,7 @@ expsort(struct strlist *str)
6407} 6408}
6408 6409
6409static void 6410static void
6410expandmeta(struct strlist *str, int flag) 6411expandmeta(struct strlist *str /*, int flag*/)
6411{ 6412{
6412 static const char metachars[] ALIGN1 = { 6413 static const char metachars[] ALIGN1 = {
6413 '*', '?', '[', 0 6414 '*', '?', '[', 0
@@ -6488,7 +6489,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
6488 ifsbreakup(p, &exparg); 6489 ifsbreakup(p, &exparg);
6489 *exparg.lastp = NULL; 6490 *exparg.lastp = NULL;
6490 exparg.lastp = &exparg.list; 6491 exparg.lastp = &exparg.list;
6491 expandmeta(exparg.list, flag); 6492 expandmeta(exparg.list /*, flag*/);
6492 } else { 6493 } else {
6493 if (flag & EXP_REDIR) /*XXX - for now, just remove escapes */ 6494 if (flag & EXP_REDIR) /*XXX - for now, just remove escapes */
6494 rmescapes(p); 6495 rmescapes(p);
@@ -6838,7 +6839,7 @@ addcmdentry(char *name, struct cmdentry *entry)
6838} 6839}
6839 6840
6840static int 6841static int
6841hashcmd(int argc, char **argv) 6842hashcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
6842{ 6843{
6843 struct tblentry **pp; 6844 struct tblentry **pp;
6844 struct tblentry *cmdp; 6845 struct tblentry *cmdp;
@@ -7139,7 +7140,7 @@ describe_command(char *command, int describe_command_verbose)
7139} 7140}
7140 7141
7141static int 7142static int
7142typecmd(int argc, char **argv) 7143typecmd(int argc ATTRIBUTE_UNUSED, char **argv)
7143{ 7144{
7144 int i = 1; 7145 int i = 1;
7145 int err = 0; 7146 int err = 0;
@@ -7150,7 +7151,7 @@ typecmd(int argc, char **argv)
7150 i++; 7151 i++;
7151 verbose = 0; 7152 verbose = 0;
7152 } 7153 }
7153 while (i < argc) { 7154 while (argv[i]) {
7154 err |= describe_command(argv[i++], verbose); 7155 err |= describe_command(argv[i++], verbose);
7155 } 7156 }
7156 return err; 7157 return err;
@@ -7158,7 +7159,7 @@ typecmd(int argc, char **argv)
7158 7159
7159#if ENABLE_ASH_CMDCMD 7160#if ENABLE_ASH_CMDCMD
7160static int 7161static int
7161commandcmd(int argc, char **argv) 7162commandcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
7162{ 7163{
7163 int c; 7164 int c;
7164 enum { 7165 enum {
@@ -7768,7 +7769,7 @@ evalsubshell(union node *n, int flags)
7768 if (!backgnd && flags & EV_EXIT && !trap[0]) 7769 if (!backgnd && flags & EV_EXIT && !trap[0])
7769 goto nofork; 7770 goto nofork;
7770 INT_OFF; 7771 INT_OFF;
7771 jp = makejob(n, 1); 7772 jp = makejob(/*n,*/ 1);
7772 if (forkshell(jp, n, backgnd) == 0) { 7773 if (forkshell(jp, n, backgnd) == 0) {
7773 INT_ON; 7774 INT_ON;
7774 flags |= EV_EXIT; 7775 flags |= EV_EXIT;
@@ -7843,7 +7844,7 @@ evalpipe(union node *n, int flags)
7843 pipelen++; 7844 pipelen++;
7844 flags |= EV_EXIT; 7845 flags |= EV_EXIT;
7845 INT_OFF; 7846 INT_OFF;
7846 jp = makejob(n, pipelen); 7847 jp = makejob(/*n,*/ pipelen);
7847 prevfd = -1; 7848 prevfd = -1;
7848 for (lp = n->npipe.cmdlist; lp; lp = lp->next) { 7849 for (lp = n->npipe.cmdlist; lp; lp = lp->next) {
7849 prehash(lp->n); 7850 prehash(lp->n);
@@ -8098,7 +8099,7 @@ mklocal(char *name)
8098 * The "local" command. 8099 * The "local" command.
8099 */ 8100 */
8100static int 8101static int
8101localcmd(int argc, char **argv) 8102localcmd(int argc ATTRIBUTE_UNUSED, char **argv)
8102{ 8103{
8103 char *name; 8104 char *name;
8104 8105
@@ -8110,21 +8111,21 @@ localcmd(int argc, char **argv)
8110} 8111}
8111 8112
8112static int 8113static int
8113falsecmd(int argc, char **argv) 8114falsecmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
8114{ 8115{
8115 return 1; 8116 return 1;
8116} 8117}
8117 8118
8118static int 8119static int
8119truecmd(int argc, char **argv) 8120truecmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
8120{ 8121{
8121 return 0; 8122 return 0;
8122} 8123}
8123 8124
8124static int 8125static int
8125execcmd(int argc, char **argv) 8126execcmd(int argc ATTRIBUTE_UNUSED, char **argv)
8126{ 8127{
8127 if (argc > 1) { 8128 if (argv[1]) {
8128 iflag = 0; /* exit on error */ 8129 iflag = 0; /* exit on error */
8129 mflag = 0; 8130 mflag = 0;
8130 optschanged(); 8131 optschanged();
@@ -8137,7 +8138,7 @@ execcmd(int argc, char **argv)
8137 * The return command. 8138 * The return command.
8138 */ 8139 */
8139static int 8140static int
8140returncmd(int argc, char **argv) 8141returncmd(int argc ATTRIBUTE_UNUSED, char **argv)
8141{ 8142{
8142 /* 8143 /*
8143 * If called outside a function, do what ksh does; 8144 * If called outside a function, do what ksh does;
@@ -8296,7 +8297,7 @@ isassignment(const char *p)
8296 return *q == '='; 8297 return *q == '=';
8297} 8298}
8298static int 8299static int
8299bltincmd(int argc, char **argv) 8300bltincmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
8300{ 8301{
8301 /* Preserve exitstatus of a previous possible redirection 8302 /* Preserve exitstatus of a previous possible redirection
8302 * as POSIX mandates */ 8303 * as POSIX mandates */
@@ -8466,7 +8467,7 @@ evalcommand(union node *cmd, int flags)
8466 /* Fork off a child process if necessary. */ 8467 /* Fork off a child process if necessary. */
8467 if (!(flags & EV_EXIT) || trap[0]) { 8468 if (!(flags & EV_EXIT) || trap[0]) {
8468 INT_OFF; 8469 INT_OFF;
8469 jp = makejob(cmd, 1); 8470 jp = makejob(/*cmd,*/ 1);
8470 if (forkshell(jp, cmd, FORK_FG) != 0) { 8471 if (forkshell(jp, cmd, FORK_FG) != 0) {
8471 exitstatus = waitforjob(jp); 8472 exitstatus = waitforjob(jp);
8472 INT_ON; 8473 INT_ON;
@@ -8596,9 +8597,9 @@ prehash(union node *n)
8596 * in the standard shell so we don't make it one here. 8597 * in the standard shell so we don't make it one here.
8597 */ 8598 */
8598static int 8599static int
8599breakcmd(int argc, char **argv) 8600breakcmd(int argc ATTRIBUTE_UNUSED, char **argv)
8600{ 8601{
8601 int n = argc > 1 ? number(argv[1]) : 1; 8602 int n = argv[1] ? number(argv[1]) : 1;
8602 8603
8603 if (n <= 0) 8604 if (n <= 0)
8604 ash_msg_and_raise_error(illnum, argv[1]); 8605 ash_msg_and_raise_error(illnum, argv[1]);
@@ -9095,7 +9096,7 @@ chkmail(void)
9095} 9096}
9096 9097
9097static void 9098static void
9098changemail(const char *val) 9099changemail(const char *val ATTRIBUTE_UNUSED)
9099{ 9100{
9100 mail_var_path_changed = 1; 9101 mail_var_path_changed = 1;
9101} 9102}
@@ -9247,13 +9248,13 @@ options(int cmdline)
9247 * The shift builtin command. 9248 * The shift builtin command.
9248 */ 9249 */
9249static int 9250static int
9250shiftcmd(int argc, char **argv) 9251shiftcmd(int argc ATTRIBUTE_UNUSED, char **argv)
9251{ 9252{
9252 int n; 9253 int n;
9253 char **ap1, **ap2; 9254 char **ap1, **ap2;
9254 9255
9255 n = 1; 9256 n = 1;
9256 if (argc > 1) 9257 if (argv[1])
9257 n = number(argv[1]); 9258 n = number(argv[1]);
9258 if (n > shellparam.nparam) 9259 if (n > shellparam.nparam)
9259 ash_msg_and_raise_error("can't shift that many"); 9260 ash_msg_and_raise_error("can't shift that many");
@@ -9308,11 +9309,11 @@ showvars(const char *sep_prefix, int on, int off)
9308 * The set command builtin. 9309 * The set command builtin.
9309 */ 9310 */
9310static int 9311static int
9311setcmd(int argc, char **argv) 9312setcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
9312{ 9313{
9313 int retval; 9314 int retval;
9314 9315
9315 if (argc == 1) 9316 if (!argv[1])
9316 return showvars(nullstr, 0, VUNSET); 9317 return showvars(nullstr, 0, VUNSET);
9317 INT_OFF; 9318 INT_OFF;
9318 retval = 1; 9319 retval = 1;
@@ -11015,20 +11016,19 @@ evalstring(char *s, int mask)
11015 * The eval command. 11016 * The eval command.
11016 */ 11017 */
11017static int 11018static int
11018evalcmd(int argc, char **argv) 11019evalcmd(int argc ATTRIBUTE_UNUSED, char **argv)
11019{ 11020{
11020 char *p; 11021 char *p;
11021 char *concat; 11022 char *concat;
11022 char **ap;
11023 11023
11024 if (argc > 1) { 11024 if (argv[1]) {
11025 p = argv[1]; 11025 p = argv[1];
11026 if (argc > 2) { 11026 argv += 2;
11027 if (argv[0]) {
11027 STARTSTACKSTR(concat); 11028 STARTSTACKSTR(concat);
11028 ap = argv + 2;
11029 for (;;) { 11029 for (;;) {
11030 concat = stack_putstr(p, concat); 11030 concat = stack_putstr(p, concat);
11031 p = *ap++; 11031 p = *argv++;
11032 if (p == NULL) 11032 if (p == NULL)
11033 break; 11033 break;
11034 STPUTC(' ', concat); 11034 STPUTC(' ', concat);
@@ -11139,16 +11139,15 @@ dotcmd(int argc, char **argv)
11139 for (sp = cmdenviron; sp; sp = sp->next) 11139 for (sp = cmdenviron; sp; sp = sp->next)
11140 setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED); 11140 setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
11141 11141
11142 if (argc >= 2) { /* That's what SVR2 does */ 11142 if (argv[1]) { /* That's what SVR2 does */
11143 char *fullname; 11143 char *fullname = find_dot_file(argv[1]);
11144 11144 argv += 2;
11145 fullname = find_dot_file(argv[1]); 11145 argc -= 2;
11146 11146 if (argc) { /* argc > 0, argv[0] != NULL */
11147 if (argc > 2) {
11148 saveparam = shellparam; 11147 saveparam = shellparam;
11149 shellparam.malloced = 0; 11148 shellparam.malloced = 0;
11150 shellparam.nparam = argc - 2; 11149 shellparam.nparam = argc;
11151 shellparam.p = argv + 2; 11150 shellparam.p = argv;
11152 }; 11151 };
11153 11152
11154 setinputfile(fullname, INPUT_PUSH_FILE); 11153 setinputfile(fullname, INPUT_PUSH_FILE);
@@ -11156,7 +11155,7 @@ dotcmd(int argc, char **argv)
11156 cmdloop(0); 11155 cmdloop(0);
11157 popfile(); 11156 popfile();
11158 11157
11159 if (argc > 2) { 11158 if (argc) {
11160 freeparam(&shellparam); 11159 freeparam(&shellparam);
11161 shellparam = saveparam; 11160 shellparam = saveparam;
11162 }; 11161 };
@@ -11166,11 +11165,11 @@ dotcmd(int argc, char **argv)
11166} 11165}
11167 11166
11168static int 11167static int
11169exitcmd(int argc, char **argv) 11168exitcmd(int argc ATTRIBUTE_UNUSED, char **argv)
11170{ 11169{
11171 if (stoppedjobs()) 11170 if (stoppedjobs())
11172 return 0; 11171 return 0;
11173 if (argc > 1) 11172 if (argv[1])
11174 exitstatus = number(argv[1]); 11173 exitstatus = number(argv[1]);
11175 raise_exception(EXEXIT); 11174 raise_exception(EXEXIT);
11176 /* NOTREACHED */ 11175 /* NOTREACHED */
@@ -11404,7 +11403,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
11404 * The trap builtin. 11403 * The trap builtin.
11405 */ 11404 */
11406static int 11405static int
11407trapcmd(int argc, char **argv) 11406trapcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
11408{ 11407{
11409 char *action; 11408 char *action;
11410 char **ap; 11409 char **ap;
@@ -11457,7 +11456,7 @@ trapcmd(int argc, char **argv)
11457 * Lists available builtins 11456 * Lists available builtins
11458 */ 11457 */
11459static int 11458static int
11460helpcmd(int argc, char **argv) 11459helpcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
11461{ 11460{
11462 int col, i; 11461 int col, i;
11463 11462
@@ -11492,7 +11491,7 @@ helpcmd(int argc, char **argv)
11492 * The export and readonly commands. 11491 * The export and readonly commands.
11493 */ 11492 */
11494static int 11493static int
11495exportcmd(int argc, char **argv) 11494exportcmd(int argc ATTRIBUTE_UNUSED, char **argv)
11496{ 11495{
11497 struct var *vp; 11496 struct var *vp;
11498 char *name; 11497 char *name;
@@ -11543,7 +11542,7 @@ unsetfunc(const char *name)
11543 * with the same name. 11542 * with the same name.
11544 */ 11543 */
11545static int 11544static int
11546unsetcmd(int argc, char **argv) 11545unsetcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
11547{ 11546{
11548 char **ap; 11547 char **ap;
11549 int i; 11548 int i;
@@ -11581,7 +11580,7 @@ static const unsigned char timescmd_str[] ALIGN1 = {
11581}; 11580};
11582 11581
11583static int 11582static int
11584timescmd(int ac, char **av) 11583timescmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
11585{ 11584{
11586 long clk_tck, s, t; 11585 long clk_tck, s, t;
11587 const unsigned char *p; 11586 const unsigned char *p;
@@ -11633,17 +11632,16 @@ dash_arith(const char *s)
11633 * Copyright (C) 2003 Vladimir Oleynik <dzo@simtreas.ru> 11632 * Copyright (C) 2003 Vladimir Oleynik <dzo@simtreas.ru>
11634 */ 11633 */
11635static int 11634static int
11636letcmd(int argc, char **argv) 11635letcmd(int argc ATTRIBUTE_UNUSED, char **argv)
11637{ 11636{
11638 char **ap; 11637 arith_t i;
11639 arith_t i = 0;
11640 11638
11641 ap = argv + 1; 11639 argv++;
11642 if (!*ap) 11640 if (!*argv)
11643 ash_msg_and_raise_error("expression expected"); 11641 ash_msg_and_raise_error("expression expected");
11644 for (ap = argv + 1; *ap; ap++) { 11642 do {
11645 i = dash_arith(*ap); 11643 i = dash_arith(*argv);
11646 } 11644 } while (*++argv);
11647 11645
11648 return !i; 11646 return !i;
11649} 11647}
@@ -11668,7 +11666,7 @@ typedef enum __rlimit_resource rlim_t;
11668 * This uses unbuffered input, which may be avoidable in some cases. 11666 * This uses unbuffered input, which may be avoidable in some cases.
11669 */ 11667 */
11670static int 11668static int
11671readcmd(int argc, char **argv) 11669readcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
11672{ 11670{
11673 char **ap; 11671 char **ap;
11674 int backslash; 11672 int backslash;
@@ -11859,7 +11857,7 @@ readcmd(int argc, char **argv)
11859} 11857}
11860 11858
11861static int 11859static int
11862umaskcmd(int argc, char **argv) 11860umaskcmd(int argc ATTRIBUTE_UNUSED, char **argv)
11863{ 11861{
11864 static const char permuser[3] ALIGN1 = "ugo"; 11862 static const char permuser[3] ALIGN1 = "ugo";
11865 static const char permmode[3] ALIGN1 = "rwx"; 11863 static const char permmode[3] ALIGN1 = "rwx";
@@ -12034,7 +12032,7 @@ printlim(enum limtype how, const struct rlimit *limit,
12034} 12032}
12035 12033
12036static int 12034static int
12037ulimitcmd(int argc, char **argv) 12035ulimitcmd(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
12038{ 12036{
12039 int c; 12037 int c;
12040 rlim_t val = 0; 12038 rlim_t val = 0;
@@ -12868,7 +12866,7 @@ init(void)
12868 * Process the shell command line arguments. 12866 * Process the shell command line arguments.
12869 */ 12867 */
12870static void 12868static void
12871procargs(int argc, char **argv) 12869procargs(char **argv)
12872{ 12870{
12873 int i; 12871 int i;
12874 const char *xminusc; 12872 const char *xminusc;
@@ -12876,7 +12874,7 @@ procargs(int argc, char **argv)
12876 12874
12877 xargv = argv; 12875 xargv = argv;
12878 arg0 = xargv[0]; 12876 arg0 = xargv[0];
12879 if (argc > 0) 12877 /* if (xargv[0]) - mmm, this is always true! */
12880 xargv++; 12878 xargv++;
12881 for (i = 0; i < NOPTS; i++) 12879 for (i = 0; i < NOPTS; i++)
12882 optlist[i] = 2; 12880 optlist[i] = 2;
@@ -12976,7 +12974,7 @@ extern int etext();
12976 * is used to figure out how far we had gotten. 12974 * is used to figure out how far we had gotten.
12977 */ 12975 */
12978int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 12976int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
12979int ash_main(int argc, char **argv) 12977int ash_main(int argc ATTRIBUTE_UNUSED, char **argv)
12980{ 12978{
12981 char *shinit; 12979 char *shinit;
12982 volatile int state; 12980 volatile int state;
@@ -13039,7 +13037,8 @@ int ash_main(int argc, char **argv)
13039#endif 13037#endif
13040 init(); 13038 init();
13041 setstackmark(&smark); 13039 setstackmark(&smark);
13042 procargs(argc, argv); 13040 procargs(argv);
13041
13043#if ENABLE_FEATURE_EDITING_SAVEHISTORY 13042#if ENABLE_FEATURE_EDITING_SAVEHISTORY
13044 if (iflag) { 13043 if (iflag) {
13045 const char *hp = lookupvar("HISTFILE"); 13044 const char *hp = lookupvar("HISTFILE");
diff --git a/shell/hush.c b/shell/hush.c
index c61607dd3..2d5697269 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -536,11 +536,13 @@ static int done_pipe(struct p_context *ctx, pipe_style type);
536static int redirect_dup_num(struct in_str *input); 536static int redirect_dup_num(struct in_str *input);
537static int redirect_opt_num(o_string *o); 537static int redirect_opt_num(o_string *o);
538#if ENABLE_HUSH_TICK 538#if ENABLE_HUSH_TICK
539static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, const char *subst_end); 539static int process_command_subs(o_string *dest, /*struct p_context *ctx,*/
540 struct in_str *input, const char *subst_end);
540#endif 541#endif
541static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch); 542static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);
542static const char *lookup_param(const char *src); 543static const char *lookup_param(const char *src);
543static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input); 544static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/
545 struct in_str *input);
544static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger); 546static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger);
545/* setup: */ 547/* setup: */
546static int parse_and_run_stream(struct in_str *inp, int parse_flag); 548static int parse_and_run_stream(struct in_str *inp, int parse_flag);
@@ -741,14 +743,14 @@ static void set_every_sighandler(void (*handler)(int))
741 signal(SIGCHLD, handler); 743 signal(SIGCHLD, handler);
742} 744}
743 745
744static void handler_ctrl_c(int sig) 746static void handler_ctrl_c(int sig ATTRIBUTE_UNUSED)
745{ 747{
746 debug_printf_jobs("got sig %d\n", sig); 748 debug_printf_jobs("got sig %d\n", sig);
747// as usual we can have all kinds of nasty problems with leaked malloc data here 749// as usual we can have all kinds of nasty problems with leaked malloc data here
748 siglongjmp(toplevel_jb, 1); 750 siglongjmp(toplevel_jb, 1);
749} 751}
750 752
751static void handler_ctrl_z(int sig) 753static void handler_ctrl_z(int sig ATTRIBUTE_UNUSED)
752{ 754{
753 pid_t pid; 755 pid_t pid;
754 756
@@ -3257,8 +3259,10 @@ static FILE *generate_stream_from_list(struct pipe *head)
3257} 3259}
3258 3260
3259/* Return code is exit status of the process that is run. */ 3261/* Return code is exit status of the process that is run. */
3260static int process_command_subs(o_string *dest, struct p_context *ctx, 3262static int process_command_subs(o_string *dest,
3261 struct in_str *input, const char *subst_end) 3263 /*struct p_context *ctx,*/
3264 struct in_str *input,
3265 const char *subst_end)
3262{ 3266{
3263 int retcode, ch, eol_cnt; 3267 int retcode, ch, eol_cnt;
3264 o_string result = NULL_O_STRING; 3268 o_string result = NULL_O_STRING;
@@ -3351,7 +3355,7 @@ static const char *lookup_param(const char *src)
3351} 3355}
3352 3356
3353/* return code: 0 for OK, 1 for syntax error */ 3357/* return code: 0 for OK, 1 for syntax error */
3354static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input) 3358static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/ struct in_str *input)
3355{ 3359{
3356 int ch = b_peek(input); /* first character after the $ */ 3360 int ch = b_peek(input); /* first character after the $ */
3357 unsigned char quote_mask = dest->o_quote ? 0x80 : 0; 3361 unsigned char quote_mask = dest->o_quote ? 0x80 : 0;
@@ -3409,7 +3413,7 @@ static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *i
3409#if ENABLE_HUSH_TICK 3413#if ENABLE_HUSH_TICK
3410 case '(': 3414 case '(':
3411 b_getch(input); 3415 b_getch(input);
3412 process_command_subs(dest, ctx, input, ")"); 3416 process_command_subs(dest, /*ctx,*/ input, ")");
3413 break; 3417 break;
3414#endif 3418#endif
3415 case '-': 3419 case '-':
@@ -3507,7 +3511,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx,
3507 b_addqchr(dest, b_getch(input), dest->o_quote); 3511 b_addqchr(dest, b_getch(input), dest->o_quote);
3508 break; 3512 break;
3509 case '$': 3513 case '$':
3510 if (handle_dollar(dest, ctx, input) != 0) { 3514 if (handle_dollar(dest, /*ctx,*/ input) != 0) {
3511 debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n"); 3515 debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n");
3512 return 1; 3516 return 1;
3513 } 3517 }
@@ -3532,7 +3536,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx,
3532 break; 3536 break;
3533#if ENABLE_HUSH_TICK 3537#if ENABLE_HUSH_TICK
3534 case '`': 3538 case '`':
3535 process_command_subs(dest, ctx, input, "`"); 3539 process_command_subs(dest, /*ctx,*/ input, "`");
3536 break; 3540 break;
3537#endif 3541#endif
3538 case '>': 3542 case '>':
diff --git a/shell/msh.c b/shell/msh.c
index 5ed6dfd1d..63f365962 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -589,7 +589,7 @@ static const struct builtincmd builtincmds[] = {
589}; 589};
590 590
591static struct op *scantree(struct op *); 591static struct op *scantree(struct op *);
592static struct op *dowholefile(int, int); 592static struct op *dowholefile(int /*, int*/);
593 593
594 594
595/* Globals */ 595/* Globals */
@@ -1448,7 +1448,7 @@ static void next(int f)
1448 PUSHIO(afile, f, filechar); 1448 PUSHIO(afile, f, filechar);
1449} 1449}
1450 1450
1451static void onintr(int s) /* ANSI C requires a parameter */ 1451static void onintr(int s ATTRIBUTE_UNUSED) /* ANSI C requires a parameter */
1452{ 1452{
1453 signal(SIGINT, onintr); 1453 signal(SIGINT, onintr);
1454 intr = 1; 1454 intr = 1;
@@ -1864,11 +1864,11 @@ static struct op *command(int cf)
1864 return t; 1864 return t;
1865} 1865}
1866 1866
1867static struct op *dowholefile(int type, int mark) 1867static struct op *dowholefile(int type /*, int mark*/)
1868{ 1868{
1869 struct op *t; 1869 struct op *t;
1870 1870
1871 DBGPRINTF(("DOWHOLEFILE: enter, type=%d, mark=%d\n", type, mark)); 1871 DBGPRINTF(("DOWHOLEFILE: enter, type=%d\n", type /*, mark*/));
1872 1872
1873 multiline++; 1873 multiline++;
1874 t = c_list(); 1874 t = c_list();
@@ -2477,7 +2477,7 @@ static int execute(struct op *t, int *pin, int *pout, int no_fork)
2477 2477
2478 newfile(evalstr(t->op_words[0], DOALL)); 2478 newfile(evalstr(t->op_words[0], DOALL));
2479 2479
2480 t->left = dowholefile(TLIST, 0); 2480 t->left = dowholefile(TLIST /*, 0*/);
2481 t->right = NULL; 2481 t->right = NULL;
2482 2482
2483 outtree = outtree_save; 2483 outtree = outtree_save;
@@ -3155,7 +3155,7 @@ static int run(struct ioarg *argp, int (*f) (struct ioarg *))
3155 * built-in commands: doX 3155 * built-in commands: doX
3156 */ 3156 */
3157 3157
3158static int dohelp(struct op *t, char **args) 3158static int dohelp(struct op *t ATTRIBUTE_UNUSED, char **args ATTRIBUTE_UNUSED)
3159{ 3159{
3160 int col; 3160 int col;
3161 const struct builtincmd *x; 3161 const struct builtincmd *x;
@@ -3191,12 +3191,12 @@ static int dohelp(struct op *t, char **args)
3191 return EXIT_SUCCESS; 3191 return EXIT_SUCCESS;
3192} 3192}
3193 3193
3194static int dolabel(struct op *t, char **args) 3194static int dolabel(struct op *t ATTRIBUTE_UNUSED, char **args ATTRIBUTE_UNUSED)
3195{ 3195{
3196 return 0; 3196 return 0;
3197} 3197}
3198 3198
3199static int dochdir(struct op *t, char **args) 3199static int dochdir(struct op *t ATTRIBUTE_UNUSED, char **args)
3200{ 3200{
3201 const char *cp, *er; 3201 const char *cp, *er;
3202 3202
@@ -3217,7 +3217,7 @@ static int dochdir(struct op *t, char **args)
3217 return 1; 3217 return 1;
3218} 3218}
3219 3219
3220static int doshift(struct op *t, char **args) 3220static int doshift(struct op *t ATTRIBUTE_UNUSED, char **args)
3221{ 3221{
3222 int n; 3222 int n;
3223 3223
@@ -3236,7 +3236,7 @@ static int doshift(struct op *t, char **args)
3236/* 3236/*
3237 * execute login and newgrp directly 3237 * execute login and newgrp directly
3238 */ 3238 */
3239static int dologin(struct op *t, char **args) 3239static int dologin(struct op *t ATTRIBUTE_UNUSED, char **args)
3240{ 3240{
3241 const char *cp; 3241 const char *cp;
3242 3242
@@ -3251,7 +3251,7 @@ static int dologin(struct op *t, char **args)
3251 return 1; 3251 return 1;
3252} 3252}
3253 3253
3254static int doumask(struct op *t, char **args) 3254static int doumask(struct op *t ATTRIBUTE_UNUSED, char **args)
3255{ 3255{
3256 int i; 3256 int i;
3257 char *cp; 3257 char *cp;
@@ -3301,7 +3301,7 @@ static int doexec(struct op *t, char **args)
3301 return 1; 3301 return 1;
3302} 3302}
3303 3303
3304static int dodot(struct op *t, char **args) 3304static int dodot(struct op *t ATTRIBUTE_UNUSED, char **args)
3305{ 3305{
3306 int i; 3306 int i;
3307 const char *sp; 3307 const char *sp;
@@ -3355,7 +3355,7 @@ static int dodot(struct op *t, char **args)
3355 return -1; 3355 return -1;
3356} 3356}
3357 3357
3358static int dowait(struct op *t, char **args) 3358static int dowait(struct op *t ATTRIBUTE_UNUSED, char **args)
3359{ 3359{
3360 int i; 3360 int i;
3361 char *cp; 3361 char *cp;
@@ -3371,7 +3371,7 @@ static int dowait(struct op *t, char **args)
3371 return 0; 3371 return 0;
3372} 3372}
3373 3373
3374static int doread(struct op *t, char **args) 3374static int doread(struct op *t ATTRIBUTE_UNUSED, char **args)
3375{ 3375{
3376 char *cp, **wp; 3376 char *cp, **wp;
3377 int nb = 0; 3377 int nb = 0;
@@ -3398,12 +3398,12 @@ static int doread(struct op *t, char **args)
3398 return nb <= 0; 3398 return nb <= 0;
3399} 3399}
3400 3400
3401static int doeval(struct op *t, char **args) 3401static int doeval(struct op *t ATTRIBUTE_UNUSED, char **args)
3402{ 3402{
3403 return RUN(awordlist, args + 1, wdchar); 3403 return RUN(awordlist, args + 1, wdchar);
3404} 3404}
3405 3405
3406static int dotrap(struct op *t, char **args) 3406static int dotrap(struct op *t ATTRIBUTE_UNUSED, char **args)
3407{ 3407{
3408 int n, i; 3408 int n, i;
3409 int resetsig; 3409 int resetsig;
@@ -3484,12 +3484,12 @@ static int getn(char *as)
3484 return n * m; 3484 return n * m;
3485} 3485}
3486 3486
3487static int dobreak(struct op *t, char **args) 3487static int dobreak(struct op *t ATTRIBUTE_UNUSED, char **args)
3488{ 3488{
3489 return brkcontin(args[1], 1); 3489 return brkcontin(args[1], 1);
3490} 3490}
3491 3491
3492static int docontinue(struct op *t, char **args) 3492static int docontinue(struct op *t ATTRIBUTE_UNUSED, char **args)
3493{ 3493{
3494 return brkcontin(args[1], 0); 3494 return brkcontin(args[1], 0);
3495} 3495}
@@ -3517,7 +3517,7 @@ static int brkcontin(char *cp, int val)
3517 /* NOTREACHED */ 3517 /* NOTREACHED */
3518} 3518}
3519 3519
3520static int doexit(struct op *t, char **args) 3520static int doexit(struct op *t ATTRIBUTE_UNUSED, char **args)
3521{ 3521{
3522 char *cp; 3522 char *cp;
3523 3523
@@ -3533,13 +3533,13 @@ static int doexit(struct op *t, char **args)
3533 return 0; 3533 return 0;
3534} 3534}
3535 3535
3536static int doexport(struct op *t, char **args) 3536static int doexport(struct op *t ATTRIBUTE_UNUSED, char **args)
3537{ 3537{
3538 rdexp(args + 1, export, EXPORT); 3538 rdexp(args + 1, export, EXPORT);
3539 return 0; 3539 return 0;
3540} 3540}
3541 3541
3542static int doreadonly(struct op *t, char **args) 3542static int doreadonly(struct op *t ATTRIBUTE_UNUSED, char **args)
3543{ 3543{
3544 rdexp(args + 1, ronly, RONLY); 3544 rdexp(args + 1, ronly, RONLY);
3545 return 0; 3545 return 0;
@@ -3575,7 +3575,7 @@ static void badid(char *s)
3575 err(": bad identifier"); 3575 err(": bad identifier");
3576} 3576}
3577 3577
3578static int doset(struct op *t, char **args) 3578static int doset(struct op *t ATTRIBUTE_UNUSED, char **args)
3579{ 3579{
3580 struct var *vp; 3580 struct var *vp;
3581 char *cp; 3581 char *cp;
@@ -3650,7 +3650,7 @@ static void times_fmt(char *buf, clock_t val, unsigned clk_tck)
3650#endif 3650#endif
3651} 3651}
3652 3652
3653static int dotimes(struct op *t, char **args) 3653static int dotimes(struct op *t ATTRIBUTE_UNUSED, char **args ATTRIBUTE_UNUSED)
3654{ 3654{
3655 struct tms buf; 3655 struct tms buf;
3656 unsigned clk_tck = sysconf(_SC_CLK_TCK); 3656 unsigned clk_tck = sysconf(_SC_CLK_TCK);
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 01d597178..983a59784 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -37,7 +37,7 @@ enum {
37}; 37};
38 38
39int klogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 39int klogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
40int klogd_main(int argc, char **argv) 40int klogd_main(int argc ATTRIBUTE_UNUSED, char **argv)
41{ 41{
42 int i = i; /* silence gcc */ 42 int i = i; /* silence gcc */
43 char *start; 43 char *start;
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 62846463c..6f4429fd9 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -68,7 +68,7 @@ static void interrupted(int sig ATTRIBUTE_UNUSED)
68} 68}
69 69
70int logread_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 70int logread_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
71int logread_main(int argc, char **argv) 71int logread_main(int argc ATTRIBUTE_UNUSED, char **argv)
72{ 72{
73 int cur; 73 int cur;
74 int log_semid; /* ipc semaphore id */ 74 int log_semid; /* ipc semaphore id */
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 596984e3f..371b5588f 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -633,7 +633,7 @@ static void do_syslogd(void)
633} 633}
634 634
635int syslogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 635int syslogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
636int syslogd_main(int argc, char **argv) 636int syslogd_main(int argc ATTRIBUTE_UNUSED, char **argv)
637{ 637{
638 char OPTION_DECL; 638 char OPTION_DECL;
639 639
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index cdd385ede..9e834ffd3 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -13,7 +13,7 @@
13#include "libbb.h" 13#include "libbb.h"
14 14
15int dmesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int dmesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int dmesg_main(int argc, char **argv) 16int dmesg_main(int argc ATTRIBUTE_UNUSED, char **argv)
17{ 17{
18 int len; 18 int len;
19 char *buf; 19 char *buf;
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 63f915ac5..058e8bed7 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -1204,7 +1204,7 @@ void check2(void);
1204#endif 1204#endif
1205 1205
1206int fsck_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1206int fsck_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1207int fsck_minix_main(int argc, char **argv) 1207int fsck_minix_main(int argc ATTRIBUTE_UNUSED, char **argv)
1208{ 1208{
1209 struct termios tmp; 1209 struct termios tmp;
1210 int retcode = 0; 1210 int retcode = 0;
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
index f226535fa..44522dfd7 100644
--- a/util-linux/hwclock.c
+++ b/util-linux/hwclock.c
@@ -91,7 +91,7 @@ static void from_sys_clock(int utc)
91#define HWCLOCK_OPT_RTCFILE 0x20 91#define HWCLOCK_OPT_RTCFILE 0x20
92 92
93int hwclock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 93int hwclock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
94int hwclock_main(int argc, char **argv) 94int hwclock_main(int argc ATTRIBUTE_UNUSED, char **argv)
95{ 95{
96 unsigned opt; 96 unsigned opt;
97 int utc; 97 int utc;
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index 97b98f300..4b5c597e5 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -559,7 +559,7 @@ static void print_sem(int semid)
559} 559}
560 560
561int ipcs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 561int ipcs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
562int ipcs_main(int argc, char **argv) 562int ipcs_main(int argc ATTRIBUTE_UNUSED, char **argv)
563{ 563{
564 int id = 0; 564 int id = 0;
565 unsigned flags = 0; 565 unsigned flags = 0;
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 9c33feb35..0edaf1047 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -244,8 +244,10 @@ static void make_device(char *path, int delete)
244} 244}
245 245
246/* File callback for /sys/ traversal */ 246/* File callback for /sys/ traversal */
247static int fileAction(const char *fileName, struct stat *statbuf, 247static int fileAction(const char *fileName,
248 void *userData, int depth) 248 struct stat *statbuf ATTRIBUTE_UNUSED,
249 void *userData,
250 int depth ATTRIBUTE_UNUSED)
249{ 251{
250 size_t len = strlen(fileName) - 4; 252 size_t len = strlen(fileName) - 4;
251 char *scratch = userData; 253 char *scratch = userData;
@@ -261,8 +263,10 @@ static int fileAction(const char *fileName, struct stat *statbuf,
261} 263}
262 264
263/* Directory callback for /sys/ traversal */ 265/* Directory callback for /sys/ traversal */
264static int dirAction(const char *fileName, struct stat *statbuf, 266static int dirAction(const char *fileName ATTRIBUTE_UNUSED,
265 void *userData, int depth) 267 struct stat *statbuf ATTRIBUTE_UNUSED,
268 void *userData ATTRIBUTE_UNUSED,
269 int depth)
266{ 270{
267 return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE); 271 return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE);
268} 272}
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index a784b72f4..3fbdc2020 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -495,7 +495,7 @@ static size_t do_check(char *buffer, size_t try, unsigned current_block)
495 return try; 495 return try;
496} 496}
497 497
498static void alarm_intr(int alnum) 498static void alarm_intr(int alnum ATTRIBUTE_UNUSED)
499{ 499{
500 if (G.currently_testing >= SB_ZONES) 500 if (G.currently_testing >= SB_ZONES)
501 return; 501 return;
@@ -621,7 +621,7 @@ static void setup_tables(void)
621} 621}
622 622
623int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 623int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
624int mkfs_minix_main(int argc, char **argv) 624int mkfs_minix_main(int argc ATTRIBUTE_UNUSED, char **argv)
625{ 625{
626 struct mntent *mp; 626 struct mntent *mp;
627 unsigned opt; 627 unsigned opt;
diff --git a/util-linux/more.c b/util-linux/more.c
index 2d5535991..257f40168 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -36,7 +36,7 @@ struct globals {
36#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp) 36#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
37#define getTermSettings(fd, argp) tcgetattr(fd, argp) 37#define getTermSettings(fd, argp) tcgetattr(fd, argp)
38 38
39static void gotsig(int sig) 39static void gotsig(int sig ATTRIBUTE_UNUSED)
40{ 40{
41 bb_putchar('\n'); 41 bb_putchar('\n');
42 setTermSettings(cin_fileno, &initial_settings); 42 setTermSettings(cin_fileno, &initial_settings);
@@ -51,7 +51,7 @@ static void gotsig(int sig)
51#define CONVERTED_TAB_SIZE 8 51#define CONVERTED_TAB_SIZE 8
52 52
53int more_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 53int more_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
54int more_main(int argc, char **argv) 54int more_main(int argc ATTRIBUTE_UNUSED, char **argv)
55{ 55{
56 int c = c; /* for gcc */ 56 int c = c; /* for gcc */
57 int lines; 57 int lines;
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 796e1e103..6e63a01fc 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -909,7 +909,7 @@ static inline int daemonize(void) { return -ENOSYS; }
909#endif 909#endif
910 910
911// TODO 911// TODO
912static inline int we_saw_this_host_before(const char *hostname) 912static inline int we_saw_this_host_before(const char *hostname ATTRIBUTE_UNUSED)
913{ 913{
914 return 0; 914 return 0;
915} 915}
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 150efbec4..9e7bdba35 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -12,7 +12,7 @@
12 12
13enum { RFC_868_BIAS = 2208988800UL }; 13enum { RFC_868_BIAS = 2208988800UL };
14 14
15static void socket_timeout(int sig) 15static void socket_timeout(int sig ATTRIBUTE_UNUSED)
16{ 16{
17 bb_error_msg_and_die("timeout connecting to time server"); 17 bb_error_msg_and_die("timeout connecting to time server");
18} 18}
@@ -43,7 +43,7 @@ static time_t askremotedate(const char *host)
43} 43}
44 44
45int rdate_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 45int rdate_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
46int rdate_main(int argc, char **argv) 46int rdate_main(int argc ATTRIBUTE_UNUSED, char **argv)
47{ 47{
48 time_t remote_time; 48 time_t remote_time;
49 unsigned long flags; 49 unsigned long flags;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index c6152558c..ef7865951 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -42,7 +42,7 @@ static const char defaultmap[] ALIGN1 = "/boot/System.map";
42static const char defaultpro[] ALIGN1 = "/proc/profile"; 42static const char defaultpro[] ALIGN1 = "/proc/profile";
43 43
44int readprofile_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 44int readprofile_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
45int readprofile_main(int argc, char **argv) 45int readprofile_main(int argc ATTRIBUTE_UNUSED, char **argv)
46{ 46{
47 FILE *map; 47 FILE *map;
48 const char *mapFile, *proFile, *mult = 0; 48 const char *mapFile, *proFile, *mult = 0;
diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c
index 2b1ab1fca..6df7334fe 100644
--- a/util-linux/rtcwake.c
+++ b/util-linux/rtcwake.c
@@ -107,7 +107,7 @@ static void suspend_system(const char *suspend)
107#define RTCWAKE_OPT_TIME 0x40 107#define RTCWAKE_OPT_TIME 0x40
108 108
109int rtcwake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 109int rtcwake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
110int rtcwake_main(int argc, char **argv) 110int rtcwake_main(int argc ATTRIBUTE_UNUSED, char **argv)
111{ 111{
112 unsigned opt; 112 unsigned opt;
113 const char *rtcname = NULL; 113 const char *rtcname = NULL;
diff --git a/util-linux/script.c b/util-linux/script.c
index a4aaa422f..c37fd9d61 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -15,13 +15,13 @@
15 15
16static smallint fd_count = 2; 16static smallint fd_count = 2;
17 17
18static void handle_sigchld(int sig) 18static void handle_sigchld(int sig ATTRIBUTE_UNUSED)
19{ 19{
20 fd_count = 0; 20 fd_count = 0;
21} 21}
22 22
23int script_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE; 23int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
24int script_main(int argc, char *argv[]) 24int script_main(int argc ATTRIBUTE_UNUSED, char **argv)
25{ 25{
26 int opt; 26 int opt;
27 int mode; 27 int mode;
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 3a1741179..c030b99e1 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -65,7 +65,7 @@ static void delete_contents(const char *directory)
65} 65}
66 66
67int switch_root_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 67int switch_root_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
68int switch_root_main(int argc, char **argv) 68int switch_root_main(int argc ATTRIBUTE_UNUSED, char **argv)
69{ 69{
70 char *newroot, *console = NULL; 70 char *newroot, *console = NULL;
71 struct stat st1, st2; 71 struct stat st1, st2;
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 3f7c0abbd..6136fa97c 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -27,7 +27,7 @@
27//#define MNT_DETACH 0x00000002 /* Just detach from the tree */ 27//#define MNT_DETACH 0x00000002 /* Just detach from the tree */
28 28
29int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 29int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30int umount_main(int argc, char **argv) 30int umount_main(int argc ATTRIBUTE_UNUSED, char **argv)
31{ 31{
32 int doForce; 32 int doForce;
33 char *const path = xmalloc(PATH_MAX + 2); /* to save stack */ 33 char *const path = xmalloc(PATH_MAX + 2); /* to save stack */