svn commit: r279503 - in head: bin/kill bin/sh bin/sh/bltin usr.bin/printf

Jilles Tjoelker jilles at FreeBSD.org
Sun Mar 1 21:46:57 UTC 2015


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
 


More information about the svn-src-all mailing list