Fix for PR# 1427, yacc-generated parser generates warnings

with -Wall.  Tim's work with some minor additions by me.

Submitted by:	Tim Vanderhoek <hoek@freenet.hamilton.on.ca>
This commit is contained in:
Steve Price 1996-09-22 02:05:53 +00:00
parent 04bd4759a8
commit 2e66d503c6

View File

@ -55,7 +55,7 @@ static char sccsid[] = "@(#)skeleton.c 5.7 (Berkeley) 5/24/93";
char *banner[] =
{
"#ifndef lint",
"static char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";",
"static char const yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";",
"#endif",
"#define YYBYACC 1",
"#define YYMAJOR 1",
@ -63,6 +63,19 @@ char *banner[] =
"#define yyclearin (yychar=(-1))",
"#define yyerrok (yyerrflag=0)",
"#define YYRECOVERING (yyerrflag!=0)",
"/* cfront 1.2 defines \"c_plusplus\" instead of \"__cplusplus\" */",
"#ifdef c_plusplus",
"#ifndef __cplusplus",
"#define __cplusplus",
"#endif",
"#endif",
"#ifdef __cplusplus",
"extern \"C\" { char *getenv(const char *); }",
"#else",
"extern char *getenv();",
"extern int yylex();",
"extern int yyparse();",
"#endif",
0
};
@ -120,17 +133,6 @@ char *body[] =
"#define YYREJECT goto yyabort",
"#define YYACCEPT goto yyaccept",
"#define YYERROR goto yyerrlab",
"/* cfront 1.2 defines \"c_plusplus\" instead of \"__cplusplus\" */",
"#ifdef c_plusplus",
"#ifndef __cplusplus",
"#define __cplusplus",
"#endif",
"#endif",
"#ifdef __cplusplus",
"extern \"C\" { char *getenv(const char *); }",
"#else",
"extern char *getenv();",
"#endif",
"",
"int",
"yyparse()",
@ -139,7 +141,7 @@ char *body[] =
"#if YYDEBUG",
" register char *yys;",
"",
" if (yys = getenv(\"YYDEBUG\"))",
" if ((yys = getenv(\"YYDEBUG\")))",
" {",
" yyn = *yys;",
" if (yyn >= '0' && yyn <= '9')",
@ -196,12 +198,12 @@ char *body[] =
" goto yyreduce;",
" }",
" if (yyerrflag) goto yyinrecovery;",
"#ifdef lint",
"#if defined(lint) || defined(__GNUC__)",
" goto yynewerror;",
"#endif",
"yynewerror:",
" yyerror(\"syntax error\");",
"#ifdef lint",
"#if defined(lint) || defined(__GNUC__)",
" goto yyerrlab;",
"#endif",
"yyerrlab:",