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>
This commit is contained in:
Sami Kerola 2012-06-10 16:37:11 +02:00
parent c42206e4a7
commit 0e9b73d3fb
10 changed files with 16 additions and 10 deletions

View File

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

View File

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

View File

@ -21,7 +21,9 @@
#include "env.h"
#ifndef HAVE_ENVIRON_DECL
extern char **environ;
#endif
static char * const forbid[] = {
"_RLD_=",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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