Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Mar 2015 21:46:55 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279503 - in head: bin/kill bin/sh bin/sh/bltin usr.bin/printf
Message-ID:  <201503012146.t21LktwP095601@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Mar  1 21:46:55 2015
New Revision: 279503
URL: https://svnweb.freebsd.org/changeset/base/279503

Log:
  sh: Fix compiler warnings related to duplicate or missing declarations.

Modified:
  head/bin/kill/kill.c
  head/bin/sh/arith_yacc.h
  head/bin/sh/arith_yylex.c
  head/bin/sh/bltin/bltin.h
  head/bin/sh/mktokens
  head/bin/sh/options.h
  head/usr.bin/printf/printf.c

Modified: head/bin/kill/kill.c
==============================================================================
--- head/bin/kill/kill.c	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/kill/kill.c	Sun Mar  1 21:46:55 2015	(r279503)
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
 #ifdef SHELL
 #define main killcmd
 #include "bltin/bltin.h"
-#include "error.h"
 #endif
 
 static void nosig(const char *);

Modified: head/bin/sh/arith_yacc.h
==============================================================================
--- head/bin/sh/arith_yacc.h	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/sh/arith_yacc.h	Sun Mar  1 21:46:55 2015	(r279503)
@@ -81,6 +81,8 @@
 #define ARITH_QMARK 37
 #define ARITH_COLON 38
 
+extern const char *arith_buf;
+
 union yystype {
 	arith_t val;
 	char *name;

Modified: head/bin/sh/arith_yylex.c
==============================================================================
--- head/bin/sh/arith_yylex.c	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/sh/arith_yylex.c	Sun Mar  1 21:46:55 2015	(r279503)
@@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$");
 #error Arithmetic tokens are out of order.
 #endif
 
-extern const char *arith_buf;
-
 int
 yylex(void)
 {

Modified: head/bin/sh/bltin/bltin.h
==============================================================================
--- head/bin/sh/bltin/bltin.h	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/sh/bltin/bltin.h	Sun Mar  1 21:46:55 2015	(r279503)
@@ -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;

Modified: head/bin/sh/mktokens
==============================================================================
--- head/bin/sh/mktokens	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/sh/mktokens	Sun Mar  1 21:46:55 2015	(r279503)
@@ -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

Modified: head/bin/sh/options.h
==============================================================================
--- head/bin/sh/options.h	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/bin/sh/options.h	Sun Mar  1 21:46:55 2015	(r279503)
@@ -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
 
 

Modified: head/usr.bin/printf/printf.c
==============================================================================
--- head/usr.bin/printf/printf.c	Sun Mar  1 21:41:37 2015	(r279502)
+++ head/usr.bin/printf/printf.c	Sun Mar  1 21:46:55 2015	(r279503)
@@ -66,7 +66,6 @@ static const char rcsid[] =
 #ifdef SHELL
 #define	main printfcmd
 #include "bltin/bltin.h"
-#include "error.h"
 #include "options.h"
 #endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503012146.t21LktwP095601>