From fd8a393086fbf43597965d5e55bec158a094a466 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 2 Dec 1996 18:27:33 +0000 Subject: [PATCH] Make gcc -Wall happy --- Parser/grammar.c | 2 +- Parser/intrcheck.c | 3 +++ Parser/myreadline.c | 2 ++ Parser/pgen.c | 40 ++++++++++++++++++++++------------------ Parser/pgenmain.c | 1 + Parser/tokenizer.c | 1 - 6 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Parser/grammar.c b/Parser/grammar.c index 3da7d3ff6f0..51bf90ea37c 100644 --- a/Parser/grammar.c +++ b/Parser/grammar.c @@ -159,7 +159,7 @@ findlabel(ll, type, str) } fprintf(stderr, "Label %d/'%s' not found\n", type, str); fatal("grammar.c:findlabel()"); - /*NOTREACHED*/ + return 0; /* Make gcc -Wall happy */ } /* Forward */ diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c index 5d02d177386..5213573a4a3 100644 --- a/Parser/intrcheck.c +++ b/Parser/intrcheck.c @@ -125,6 +125,9 @@ intrcheck() #include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif static int interrupted; diff --git a/Parser/myreadline.c b/Parser/myreadline.c index a94df8f549c..5eff847d161 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -54,6 +54,8 @@ PERFORMANCE OF THIS SOFTWARE. extern char *readline(); extern int rl_initialize(); extern int rl_insert(); +extern int rl_bind_key(); +extern void add_history(); extern char *rl_readline_name; #include diff --git a/Parser/pgen.c b/Parser/pgen.c index dff4aed7042..c5a0618479c 100644 --- a/Parser/pgen.c +++ b/Parser/pgen.c @@ -66,10 +66,14 @@ typedef struct _nfa { } nfa; /* Forward */ -static compile_rhs PROTO((labellist *ll, nfa *nf, node *n, int *pa, int *pb)); -static compile_alt PROTO((labellist *ll, nfa *nf, node *n, int *pa, int *pb)); -static compile_item PROTO((labellist *ll, nfa *nf, node *n, int *pa, int *pb)); -static compile_atom PROTO((labellist *ll, nfa *nf, node *n, int *pa, int *pb)); +static void compile_rhs PROTO((labellist *ll, + nfa *nf, node *n, int *pa, int *pb)); +static void compile_alt PROTO((labellist *ll, + nfa *nf, node *n, int *pa, int *pb)); +static void compile_item PROTO((labellist *ll, + nfa *nf, node *n, int *pa, int *pb)); +static void compile_atom PROTO((labellist *ll, + nfa *nf, node *n, int *pa, int *pb)); static int addnfastate(nf) @@ -128,7 +132,7 @@ typedef struct _nfagrammar { } nfagrammar; /* Forward */ -static compile_rule PROTO((nfagrammar *gr, node *n)); +static void compile_rule PROTO((nfagrammar *gr, node *n)); static nfagrammar * newnfagrammar() @@ -195,7 +199,7 @@ metacompile(n) return gr; } -static +static void compile_rule(gr, n) nfagrammar *gr; node *n; @@ -216,7 +220,7 @@ compile_rule(gr, n) REQ(n, NEWLINE); } -static +static void compile_rhs(ll, nf, n, pa, pb) labellist *ll; nfa *nf; @@ -253,7 +257,7 @@ compile_rhs(ll, nf, n, pa, pb) } } -static +static void compile_alt(ll, nf, n, pa, pb) labellist *ll; nfa *nf; @@ -284,7 +288,7 @@ compile_alt(ll, nf, n, pa, pb) } } -static +static void compile_item(ll, nf, n, pa, pb) labellist *ll; nfa *nf; @@ -325,7 +329,7 @@ compile_item(ll, nf, n, pa, pb) } } -static +static void compile_atom(ll, nf, n, pa, pb) labellist *ll; nfa *nf; @@ -437,12 +441,12 @@ typedef struct _ss_dfa { } ss_dfa; /* Forward */ -static printssdfa PROTO((int xx_nstates, ss_state *xx_state, int nbits, - labellist *ll, char *msg)); -static simplify PROTO((int xx_nstates, ss_state *xx_state)); -static convert PROTO((dfa *d, int xx_nstates, ss_state *xx_state)); +static void printssdfa PROTO((int xx_nstates, ss_state *xx_state, int nbits, + labellist *ll, char *msg)); +static void simplify PROTO((int xx_nstates, ss_state *xx_state)); +static void convert PROTO((dfa *d, int xx_nstates, ss_state *xx_state)); -static +static void makedfa(gr, nf, d) nfagrammar *gr; nfa *nf; @@ -548,7 +552,7 @@ makedfa(gr, nf, d) /* XXX cleanup */ } -static +static void printssdfa(xx_nstates, xx_state, nbits, ll, msg) int xx_nstates; ss_state *xx_state; @@ -629,7 +633,7 @@ renamestates(xx_nstates, xx_state, from, to) } } -static +static void simplify(xx_nstates, xx_state) int xx_nstates; ss_state *xx_state; @@ -661,7 +665,7 @@ simplify(xx_nstates, xx_state) /* Convert the DFA into a grammar that can be used by our parser */ -static +static void convert(d, xx_nstates, xx_state) dfa *d; int xx_nstates; diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 98b5ac5c03e..d0395e9aea9 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -101,6 +101,7 @@ main(argc, argv) printnonterminals(g, fp); fclose(fp); goaway(0); + return 0; /* Make gcc -Wall happy */ } grammar * diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index cff9179fc97..8a726e0ea3f 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -279,7 +279,6 @@ tok_nextc(tok) int curstart = tok->start == NULL ? -1 : tok->start - tok->buf; int curvalid = tok->inp - tok->buf; - int cursize = tok->end - tok->buf; int newsize = curvalid + BUFSIZ; char *newbuf = tok->buf; RESIZE(newbuf, char, newsize);