aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2015-03-01 21:46:55 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2015-03-01 21:46:55 +0000
commit22ea47ec90b51ecbe6d2883ccee30d312c162044 (patch)
tree8f9339bae861ac41857ef95632f9b0d69ac68a65
parent03afe9ba7014d242d5f76a956879794668caa290 (diff)
downloadsrc-22ea47ec90b51ecbe6d2883ccee30d312c162044.tar.gz
src-22ea47ec90b51ecbe6d2883ccee30d312c162044.zip
sh: Fix compiler warnings related to duplicate or missing declarations.
Notes
Notes: svn path=/head/; revision=279503
-rw-r--r--bin/kill/kill.c1
-rw-r--r--bin/sh/arith_yacc.h2
-rw-r--r--bin/sh/arith_yylex.c2
-rw-r--r--bin/sh/bltin/bltin.h2
-rw-r--r--bin/sh/mktokens4
-rw-r--r--bin/sh/options.h3
-rw-r--r--usr.bin/printf/printf.c1
7 files changed, 6 insertions, 9 deletions
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index b23c00acf21c..bfa274bc129c 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#ifdef SHELL
#define main killcmd
#include "bltin/bltin.h"
-#include "error.h"
#endif
static void nosig(const char *);
diff --git a/bin/sh/arith_yacc.h b/bin/sh/arith_yacc.h
index 5d8354fa2a16..ca92e6f7fa17 100644
--- a/bin/sh/arith_yacc.h
+++ b/bin/sh/arith_yacc.h
@@ -81,6 +81,8 @@
#define ARITH_QMARK 37
#define ARITH_COLON 38
+extern const char *arith_buf;
+
union yystype {
arith_t val;
char *name;
diff --git a/bin/sh/arith_yylex.c b/bin/sh/arith_yylex.c
index ad0818426de5..f7eaf3e3fa6d 100644
--- a/bin/sh/arith_yylex.c
+++ b/bin/sh/arith_yylex.c
@@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$");
#error Arithmetic tokens are out of order.
#endif
-extern const char *arith_buf;
-
int
yylex(void)
{
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index bbf55f1ae79f..a530ab78b2a5 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -42,6 +42,7 @@
#include "../shell.h"
#include "../mystring.h"
#ifdef SHELL
+#include "../error.h"
#include "../output.h"
#include "builtins.h"
#define FILE struct output
@@ -73,7 +74,6 @@
#include <unistd.h>
pointer stalloc(int);
-void error(const char *, ...) __printf0like(1, 2);
int killjob(const char *, int);
extern char *commandname;
diff --git a/bin/sh/mktokens b/bin/sh/mktokens
index 82d7cd7b2d5a..b6f5f97638a1 100644
--- a/bin/sh/mktokens
+++ b/bin/sh/mktokens
@@ -74,11 +74,11 @@ exec > token.h
awk '{print "#define " $1 " " NR-1}' $temp
echo '
/* Array indicating which tokens mark the end of a list */
-const char tokendlist[] = {'
+static const char tokendlist[] = {'
awk '{print "\t" $2 ","}' $temp
echo '};
-const char *const tokname[] = {'
+static const char *const tokname[] = {'
sed -e 's/"/\\"/g' \
-e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \
$temp
diff --git a/bin/sh/options.h b/bin/sh/options.h
index 09948628197d..2048a354b6e5 100644
--- a/bin/sh/options.h
+++ b/bin/sh/options.h
@@ -73,6 +73,7 @@ struct optent {
char val;
};
+extern struct optent optlist[NOPTS];
#ifdef DEFINE_OPTIONS
struct optent optlist[NOPTS] = {
{ "errexit", 'e', 0 },
@@ -95,8 +96,6 @@ struct optent optlist[NOPTS] = {
{ "physical", 'P', 0 },
{ "trackall", 'h', 0 },
};
-#else
-extern struct optent optlist[NOPTS];
#endif
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 452711e1e39a..8636cc13c1ef 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -66,7 +66,6 @@ static const char rcsid[] =
#ifdef SHELL
#define main printfcmd
#include "bltin/bltin.h"
-#include "error.h"
#include "options.h"
#endif