diff options
author | Sami Kerola | 2012-06-10 16:37:11 +0200 |
---|---|---|
committer | Sami Kerola | 2012-06-11 19:51:35 +0200 |
commit | 0e9b73d3fb5e3c7a5146af65e119e297dcf75487 (patch) | |
tree | 8528c62980a043ea589484d8aa518aa91a96963f | |
parent | include: fix spurious list.h warnings (diff) | |
download | kernel-qcow2-util-linux-0e9b73d3fb5e3c7a5146af65e119e297dcf75487.tar.gz kernel-qcow2-util-linux-0e9b73d3fb5e3c7a5146af65e119e297dcf75487.tar.xz kernel-qcow2-util-linux-0e9b73d3fb5e3c7a5146af65e119e297dcf75487.zip |
build: fix redundant redeclaration warnings
env.c:24:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls]
su.c:81:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls]
fstab.c:581:14: warning: redundant redeclaration of 'strsignal' [-Wredundant-decls]
kill.h:1:13: note: previous declaration of 'get_pids' was here
kill.c:152:13: warning: redundant redeclaration of 'get_pids' [-Wredundant-decls]
kill.c:142:5: warning: redundant redeclaration of 'main' [-Wredundant-decls]
getopt.c:89:5: warning: redundant redeclaration of 'main' [-Wredundant-decls]
agetty.c:536:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls]
agetty.c:537:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
script.c:161:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
wall.c:96:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
libmount.h:362:26: note: previous declaration of 'mnt_update_get_fs' was here
libmount.h:454:26: note: previous declaration of 'mnt_context_get_fs' was here
mountP.h:383:26: warning: redundant redeclaration of 'mnt_context_get_fs' [-Wredundant-decls]
mountP.h:398:26: warning: redundant redeclaration of 'mnt_update_get_fs' [-Wredundant-decls]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | getopt/getopt.c | 1 | ||||
-rw-r--r-- | lib/env.c | 2 | ||||
-rw-r--r-- | libmount/src/mountP.h | 2 | ||||
-rw-r--r-- | login-utils/su.c | 2 | ||||
-rw-r--r-- | misc-utils/kill.c | 3 | ||||
-rw-r--r-- | mount/fstab.c | 2 | ||||
-rw-r--r-- | term-utils/agetty.c | 2 | ||||
-rw-r--r-- | term-utils/script.c | 1 | ||||
-rw-r--r-- | term-utils/wall.c | 1 |
10 files changed, 16 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 2280e7e51..0669f0ab5 100644 --- a/configure.ac +++ b/configure.ac @@ -262,6 +262,16 @@ AC_CHECK_DECL([lseek64], #define _LARGEFILE64_SOURCE #include <unistd.h>]) +AC_CHECK_DECL([environ], + [AC_DEFINE(HAVE_ENVIRON_DECL, 1, + [Define to 1 if have **environ prototype])], +) + +AC_CHECK_DECL([strsignal], + [AC_DEFINE(HAVE_STRSIGNAL_DECL, 1, + [Define to 1 if have strsignal function prototype])], +) + AC_CHECK_FUNCS([ \ __fpending \ __secure_getenv \ diff --git a/getopt/getopt.c b/getopt/getopt.c index dcc55b6b1..4ba340193 100644 --- a/getopt/getopt.c +++ b/getopt/getopt.c @@ -86,7 +86,6 @@ int (*getopt_long_fp) (int argc, char *const *argv, const char *optstr, static const char *normalize(const char *arg); static int generate_output(char *argv[], int argc, const char *optstr, const struct option *longopts); -int main(int argc, char *argv[]); static void parse_error(const char *message); static void add_long_options(char *options); static void add_longopt(const char *name, int has_arg); @@ -21,7 +21,9 @@ #include "env.h" +#ifndef HAVE_ENVIRON_DECL extern char **environ; +#endif static char * const forbid[] = { "_RLD_=", diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index c7d378eeb..f7cd7d53d 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -380,7 +380,6 @@ extern int mnt_context_guess_fstype(struct libmnt_context *cxt); extern int mnt_context_prepare_helper(struct libmnt_context *cxt, const char *name, const char *type); extern int mnt_context_prepare_update(struct libmnt_context *cxt); -extern struct libmnt_fs *mnt_context_get_fs(struct libmnt_context *cxt); extern int mnt_context_merge_mflags(struct libmnt_context *cxt); extern int mnt_context_update_tabs(struct libmnt_context *cxt); @@ -395,7 +394,6 @@ extern int mnt_context_clear_loopdev(struct libmnt_context *cxt); extern int mnt_fork_context(struct libmnt_context *cxt); /* tab_update.c */ -extern struct libmnt_fs *mnt_update_get_fs(struct libmnt_update *upd); extern int mnt_update_set_filename(struct libmnt_update *upd, const char *filename, int userspace_only); diff --git a/login-utils/su.c b/login-utils/su.c index 0f535b9b7..26222099b 100644 --- a/login-utils/su.c +++ b/login-utils/su.c @@ -78,7 +78,9 @@ enum /* The user to become if none is specified. */ #define DEFAULT_USER "root" +#ifndef HAVE_ENVIRON_DECL extern char **environ; +#endif static void run_shell (char const *, char const *, char **, size_t) __attribute__ ((__noreturn__)); diff --git a/misc-utils/kill.c b/misc-utils/kill.c index c592f5203..8e2a1d87e 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -139,7 +139,6 @@ struct signv { #endif }; -int main (int argc, char *argv[]); extern char *mybasename(char *); int signame_to_signum (char *sig); int arg_to_signum (char *arg, int mask); @@ -149,8 +148,6 @@ void printsignals (FILE *fp); int usage (int status); int kill_verbose (char *procname, int pid, int sig); -extern int *get_pids (char *, int); - static char *progname; #ifdef HAVE_SIGQUEUE diff --git a/mount/fstab.c b/mount/fstab.c index 043cc43e2..a39459138 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -578,7 +578,9 @@ static int lockfile_fd = -1; static int signals_have_been_setup = 0; /* Ensure that the lock is released if we are interrupted. */ +#ifndef HAVE_STRSIGNAL_DECL extern char *strsignal(int sig); /* not always in <string.h> */ +#endif static void handler (int sig) { diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 9101e7fd3..862b8c49d 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -533,8 +533,6 @@ static void login_options_to_argv(char *argv[], int *argc, /* Parse command-line arguments. */ static void parse_args(int argc, char **argv, struct options *op) { - extern char *optarg; - extern int optind; int c; enum { diff --git a/term-utils/script.c b/term-utils/script.c index 07be7e987..05d9f8541 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -158,7 +158,6 @@ int main(int argc, char **argv) { sigset_t block_mask, unblock_mask; struct sigaction sa; - extern int optind; int ch; FILE *timingfd = stderr; diff --git a/term-utils/wall.c b/term-utils/wall.c index 3255a5166..996650638 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -93,7 +93,6 @@ static void __attribute__((__noreturn__)) usage(FILE *out) int main(int argc, char **argv) { - extern int optind; int ch; struct iovec iov; struct utmp *utmpptr; |