*: 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
This commit is contained in:
Denis Vlasenko
2008-03-17 09:00:54 +00:00
parent a55bd05f3c
commit 68404f13d4
138 changed files with 352 additions and 327 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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];

View File

@@ -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";

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();