* configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare

rather than -W, so we don't get bogus warnings about sign comparisons.
Add -Wpointer-arith, since that warning is useful (it reports code
that does not conform to C89 and that some compilers reject).
* data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
since it's no longer needed.
This commit is contained in:
Paul Eggert
2006-08-11 19:50:14 +00:00
parent f9bfc42aa7
commit 34ec357927
5 changed files with 14 additions and 35 deletions

View File

@@ -608,8 +608,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || yylast_ < yyn
|| (]b4_safest_int_type[)yycheck_[yyn] != yytoken)
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
goto yydefault;
/* Reduce or error. */
@@ -687,7 +686,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
yyn = yyr1_[yyn];
yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
if (0 <= yystate && yystate <= yylast_
&& (]b4_safest_int_type[)yycheck_[yystate] == yystate_stack_[0])
&& yycheck_[yystate] == yystate_stack_[0])
yystate = yytable_[yystate];
else
yystate = yydefgoto_[yyn - yyntokens_];
@@ -760,8 +759,7 @@ b4_error_verbose_if([, yytoken])[));
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_
&& (]b4_safest_int_type[)yycheck_[yyn] == yyterror_)
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
@@ -845,7 +843,7 @@ b4_error_verbose_if([, int tok])[)
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if ((]b4_safest_int_type[)yycheck_[x + yyn] == x && x != yyterror_)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
// FIXME: This method of building the message is not compatible
@@ -862,8 +860,7 @@ b4_error_verbose_if([, int tok])[)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if ((]b4_safest_int_type[)yycheck_[x + yyn] == x
&& x != yyterror_)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res += (!count++) ? ", expecting " : " or ";
res += yytnamerr_ (yytname_[x]);