summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
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 18a74b8..181d96a 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 5f5f1bf..a5ee534 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 a58e4f8..1bd0bd5 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 df3b77d..eaaefaf 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 67088e0..4dbc0d4 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 4f0bed3..ed6f8f6 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 3941151..7495f7a 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 771f610..fd6c950 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 7273d39..f678565 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 96a74a3..c013395 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 7dba802..9afb100 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 687c7cc..c1796b3 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 3776215..32e55a5 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 d298ada..d9261b9 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 55f5310..0c69494 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 ac604db..9279dbe 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 1ab9459..3f13a36 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 a123156..1774ce2 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 96bee23..cb60466 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 d8df4c5..510f7a2 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 895a04b..cf26a93 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 9dbdd98..5c9d092 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 7951be2..ddadcc7 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 3fe8b64..0b58179 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 a28ab46..d0af63a 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 2b59193..565e68b 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 b0a50ff..48e1511 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 cda1e61..d072960 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 4683662..34a2239 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 58ea1c7..de3c895 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 e6bd0af..a206ec5 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 e2fdfc9..d35572e 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();