summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-04-01 17:18:22 +0000
committerjilles <jilles@FreeBSD.org>2013-04-01 17:18:22 +0000
commit3deb97fc0b145c3f68e924fbc0d4c173749860fd (patch)
tree9a5917477e371894a700d8481509e110a980c3bd /bin/sh/parser.c
parentf09dcb3ac2cf988f73865370bf0a644a3905b5b2 (diff)
downloadFreeBSD-src-3deb97fc0b145c3f68e924fbc0d4c173749860fd.zip
FreeBSD-src-3deb97fc0b145c3f68e924fbc0d4c173749860fd.tar.gz
sh: Fix various compiler warnings.
It now passes WARNS=7 with clang on i386. GCC 4.2.1 does not understand setjmp() properly so will always trigger -Wuninitialized. I will not add the volatile keywords to suppress this.
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 665b53f..073c2b6 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -119,7 +119,7 @@ static void parseheredoc(void);
static int peektoken(void);
static int readtoken(void);
static int xxreadtoken(void);
-static int readtoken1(int, char const *, char *, int);
+static int readtoken1(int, const char *, const char *, int);
static int noexpand(char *);
static void synexpect(int) __dead2;
static void synerror(const char *) __dead2;
@@ -983,7 +983,7 @@ parsebackq(char *out, struct nodelist **pbqlist,
char *volatile str;
struct jmploc jmploc;
struct jmploc *const savehandler = handler;
- int savelen;
+ size_t savelen;
int saveprompt;
const int bq_startlinno = plinno;
char *volatile ostr = NULL;
@@ -1300,7 +1300,8 @@ readcstyleesc(char *out)
#define PARSEARITH() {goto parsearith; parsearith_return:;}
static int
-readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs)
+readtoken1(int firstc, char const *initialsyntax, const char *eofmark,
+ int striptabs)
{
int c = firstc;
char *out;
@@ -1521,7 +1522,7 @@ checkend: {
}
if (c == *eofmark) {
if (pfgets(line, sizeof line) != NULL) {
- char *p, *q;
+ const char *p, *q;
p = line;
for (q = eofmark + 1 ; *q && *p == *q ; p++, q++);
@@ -2038,7 +2039,7 @@ getprompt(void *unused __unused)
const char *
-expandstr(char *ps)
+expandstr(const char *ps)
{
union node n;
struct jmploc jmploc;
OpenPOWER on IntegriCloud