aboutsummaryrefslogtreecommitdiff
path: root/coreutils
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 /coreutils
parenta55bd05f3cea6c7cbfb45d15009cb70570c2a43b (diff)
downloadbusybox-68404f13d4bf4826e3609703dad5375763db28ab.tar.gz
*: 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
Diffstat (limited to 'coreutils')
-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
32 files changed, 39 insertions, 36 deletions
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)
}
int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int cat_main(int argc, char **argv)
+int cat_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
getopt32(argv, "u");
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 @@
#include "libbb.h"
int catv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int catv_main(int argc, char **argv)
+int catv_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int retval = EXIT_SUCCESS;
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
}
int chmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int chmod_main(int argc, char **argv)
+int chmod_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int retval = EXIT_SUCCESS;
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);
static struct bb_uidgid_t ugid = { -1, -1 };
static int fileAction(const char *fileName, struct stat *statbuf,
- void *cf, int depth)
+ void *cf, int depth ATTRIBUTE_UNUSED)
{
uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid;
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,
}
int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int chown_main(int argc, char **argv)
+int chown_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int retval = EXIT_SUCCESS;
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)
}
int comm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int comm_main(int argc, char **argv)
+int comm_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
#define LINE_LEN 100
#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)
}
int cut_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int cut_main(int argc, char **argv)
+int cut_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
char delim = '\t'; /* delimiter, default is tab */
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)
}
int du_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int du_main(int argc, char **argv)
+int du_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
unsigned long total;
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 @@
* using call -> jump optimization */
int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int echo_main(int argc, char **argv)
+int echo_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
const char *arg;
#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 =
#endif
int env_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int env_main(int argc, char **argv)
+int env_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
/* cleanenv was static - why? */
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)
#endif
int expand_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int expand_main(int argc, char **argv)
+int expand_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
/* Default 8 spaces for 1 tab */
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)
}
int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int id_main(int argc, char **argv)
+int id_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
struct passwd *p;
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);
int cp_mv_stat2(const char *fn, struct stat *fn_stat, stat_func sf);
int cp_mv_stat(const char *fn, struct stat *fn_stat);
-mode_t getopt_mk_fifo_nod(int argc, char **argv);
+mode_t getopt_mk_fifo_nod(char **argv);
#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 @@
#include "libbb.h"
#include "coreutils.h"
-mode_t getopt_mk_fifo_nod(int argc, char **argv)
+mode_t getopt_mk_fifo_nod(char **argv)
{
mode_t mode = 0666;
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 @@
#include "libcoreutils/coreutils.h"
int mkfifo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int mkfifo_main(int argc, char **argv)
+int mkfifo_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
mode_t mode;
int retval = EXIT_SUCCESS;
- mode = getopt_mk_fifo_nod(argc, argv);
+ mode = getopt_mk_fifo_nod(argv);
argv += optind;
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)
dev_t dev;
const char *name;
- mode = getopt_mk_fifo_nod(argc, argv);
+ mode = getopt_mk_fifo_nod(argv);
argv += optind;
argc -= optind;
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 @@
/* This is a NOFORK applet. Be very careful! */
int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int pwd_main(int argc, char **argv)
+int pwd_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
char *buf;
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 @@
#include "libbb.h"
int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int readlink_main(int argc, char **argv)
+int readlink_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
char *buf;
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 @@
/* This is a NOFORK applet. Be very careful! */
int rm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int rm_main(int argc, char **argv)
+int rm_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int status = 0;
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 @@
#define IGNORE_NON_EMPTY 0x02
int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int rmdir_main(int argc, char **argv)
+int rmdir_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int status = EXIT_SUCCESS;
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)
#endif
int sort_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int sort_main(int argc, char **argv)
+int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
FILE *fp, *outfile = stdout;
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 };
#define SPLIT_OPT_a (1<<2)
int split_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int split_main(int argc, char **argv)
+int split_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
unsigned suffix_len = 2;
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 @@
/* This is a NOFORK applet. Be very careful! */
int sync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int sync_main(int argc, char **argv)
+int sync_main(int argc, char **argv ATTRIBUTE_UNUSED)
{
+ /* coreutils-6.9 compat */
bb_warn_ignoring_args(argc - 1);
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 {
};
int tac_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int tac_main(int argc, char **argv)
+int tac_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
char **name;
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 @@
/* This is a NOFORK applet. Be very careful! */
int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int touch_main(int argc, char **argv)
+int touch_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int fd;
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)
}
int tr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int tr_main(int argc, char **argv)
+int tr_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
int output_length = 0, input_length;
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 @@
/* This is a NOFORK applet. Be very careful! */
int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int true_main(int argc, char **argv)
+int true_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
return EXIT_SUCCESS;
}
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 @@
#include "libbb.h"
int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int tty_main(int argc, char **argv)
+int tty_main(int argc, char **argv SKIP_INCLUDE_SUSv2(ATTRIBUTE_UNUSED))
{
const char *s;
USE_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */
@@ -22,15 +22,17 @@ int tty_main(int argc, char **argv)
xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */
USE_INCLUDE_SUSv2(silent = getopt32(argv, "s");)
+ USE_INCLUDE_SUSv2(argc -= optind;)
+ SKIP_INCLUDE_SUSv2(argc -= 1;)
/* gnu tty outputs a warning that it is ignoring all args. */
- bb_warn_ignoring_args(argc - optind);
+ bb_warn_ignoring_args(argc);
retval = 0;
s = ttyname(0);
if (s == NULL) {
- /* According to SUSv3, ttyname can on fail with EBADF or ENOTTY.
+ /* According to SUSv3, ttyname can fail with EBADF or ENOTTY.
* We know the file descriptor is good, so failure means not a tty. */
s = "not a tty";
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)
}
int uniq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int uniq_main(int argc, char **argv)
+int uniq_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
FILE *in, *out;
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)
}
int uudecode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int uudecode_main(int argc, char **argv)
+int uudecode_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
FILE *src_stream = stdin;
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 {
};
int wc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int wc_main(int argc, char **argv)
+int wc_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
FILE *fp;
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)
}
int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int who_main(int argc, char **argv)
+int who_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
char str6[6];
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 @@
/* This is a NOFORK applet. Be very careful! */
int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int whoami_main(int argc, char **argv)
+int whoami_main(int argc, char **argv ATTRIBUTE_UNUSED)
{
if (argc > 1)
bb_show_usage();