Fix warnings, some of them serious because sh violated name

spaces reserved by the header files it includes.

mkinit.c still produces C code with redundant declarations, although
they are more harmless since they automatically derived from the right
places.
This commit is contained in:
Martin Cracauer 2000-04-20 09:49:16 +00:00
parent 1ea7321b72
commit f01e3d0cfe
8 changed files with 8 additions and 17 deletions

View File

@ -45,7 +45,6 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <unistd.h>
#include "y.tab.h"
#include "error.h"

View File

@ -82,7 +82,6 @@ extern volatile sig_atomic_t exception;
extern volatile sig_atomic_t suppressint;
extern volatile sig_atomic_t intpending;
extern char *commandname; /* name of command--printed on error */
#define INTOFF suppressint++
#define INTON { if (--suppressint == 0 && intpending) onint(); }

View File

@ -168,8 +168,6 @@ histcmd(argc, argv)
int argc;
char **argv;
{
extern char *optarg;
extern int optind, optopt, optreset;
int ch;
char *editor = NULL;
const HistEvent *he;
@ -210,7 +208,7 @@ histcmd(argc, argv)
(ch = getopt(argc, argv, ":e:lnrs")) != -1)
switch ((char)ch) {
case 'e':
editor = optarg;
editor = shoptarg;
break;
case 'l':
lflg = 1;

View File

@ -971,7 +971,6 @@ stoppedjobs()
STATIC char *cmdnextc;
STATIC int cmdnleft;
STATIC void cmdtxt(), cmdputs();
#define MAXCMDTEXT 200
char *

View File

@ -67,9 +67,6 @@ static const char rcsid[] =
#undef eflag
extern char **argptr; /* argument list for builtin command */
/*
* The read builtin. The -r option causes backslashes to be treated like
* ordinary characters.
@ -105,7 +102,7 @@ readcmd(argc, argv)
while ((i = nextopt("erp:t:")) != '\0') {
switch(i) {
case 'p':
prompt = optarg;
prompt = shoptarg;
break;
case 'e':
break;
@ -113,8 +110,8 @@ readcmd(argc, argv)
rflag = 1;
break;
case 't':
tv.tv_sec = strtol(optarg, &tvptr, 0);
if (tvptr == optarg)
tv.tv_sec = strtol(shoptarg, &tvptr, 0);
if (tvptr == shoptarg)
error("timeout value");
switch(*tvptr) {
case 0:

View File

@ -67,7 +67,7 @@ static const char rcsid[] =
char *arg0; /* value of $0 */
struct shparam shellparam; /* current positional parameters */
char **argptr; /* argument list for builtin commands */
char *optarg; /* set by nextopt (like getopt) */
char *shoptarg; /* set by nextopt (like getopt) */
char *optptr; /* used by nextopt */
char *minusc; /* argument to -c option */
@ -539,7 +539,7 @@ nextopt(optstring)
if (*++q == ':') {
if (*p == '\0' && (p = *argptr++) == NULL)
error("No arg for -%c option", c);
optarg = p;
shoptarg = p;
p = NULL;
}
optptr = p;

View File

@ -103,7 +103,7 @@ extern char *minusc; /* argument to -c option */
extern char *arg0; /* $0 */
extern struct shparam shellparam; /* $@ */
extern char **argptr; /* argument list for builtin commands */
extern char *optarg; /* set by nextopt */
extern char *shoptarg; /* set by nextopt */
extern char *optptr; /* used by nextopt */
void procargs __P((int, char **));

View File

@ -59,6 +59,7 @@ static const char rcsid[] =
#include "mystring.h"
#include "alias.h"
#include "show.h"
#include "eval.h"
#ifndef NO_HISTORY
#include "myhistedit.h"
#endif
@ -678,8 +679,6 @@ peektoken() {
return (t);
}
STATIC int xxreadtoken();
STATIC int
readtoken() {
int t;