From: Jarkko Hietaniemi Date: Tue, 12 Jun 2001 01:35:34 +0000 (+0000) Subject: Cleanup the a2p.c for -Wall. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=08e61bccdfbdea504a137785230ae6bd350c2bdb;p=p5sagit%2Fp5-mst-13.2.git Cleanup the a2p.c for -Wall. p4raw-id: //depot/perl@10526 --- diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH index 25085fc..5db022f 100755 --- a/x2p/Makefile.SH +++ b/x2p/Makefile.SH @@ -111,11 +111,20 @@ a2p: $(obj) a2p$(OBJ_EXT) # used only if you force byacc to run by saying # make run_byacc -run_byacc: FORCE +check_byacc: + @$(BYACC) -V 2>&1 | grep 'version 1\.8\.2' + +run_byacc: FORCE check_byacc @ echo Expect many shift/reduce and reduce/reduce conflicts $(BYACC) a2p.y rm -f a2p.c - mv y.tab.c a2p.c + sed -e 's/(yyn = yydefred\[yystate\])/((yyn = yydefred[yystate]))/' \ + -e 's/^yyerrlab://' \ + -e 's/^ goto yyerrlab;//' \ + -e 's/^yynewerror://' \ + -e 's/^ goto yynewerror;//' \ + -e 's|^static char yysccsid\(.*\)|/* static char yysccsid\1 */|' \ + < y.tab.c > a2p.c FORCE: diff --git a/x2p/a2p.c b/x2p/a2p.c index cd667a3..4cf6c51 100644 --- a/x2p/a2p.c +++ b/x2p/a2p.c @@ -1,5 +1,5 @@ #ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; +/* static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; */ #endif #define YYBYACC 1 #line 2 "a2p.y" @@ -2087,9 +2087,8 @@ yyparse() register int yym, yyn, yystate; #if YYDEBUG register char *yys; -#ifndef __cplusplus extern char *getenv(); -#endif + if (yys = getenv("YYDEBUG")) { yyn = *yys; @@ -2107,7 +2106,7 @@ yyparse() *yyssp = yystate = 0; yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; + if ((yyn = yydefred[yystate])) goto yyreduce; if (yychar < 0) { if ((yychar = yylex()) < 0) yychar = 0; @@ -2148,14 +2147,14 @@ yyloop: } if (yyerrflag) goto yyinrecovery; #ifdef lint - goto yynewerror; + #endif -yynewerror: + yyerror("syntax error"); #ifdef lint - goto yyerrlab; + #endif -yyerrlab: + ++yynerrs; yyinrecovery: if (yyerrflag < 3)