mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
(grammar_rule_check): Rewrite slightly to avoid GCC warnings.
This commit is contained in:
14
src/reader.c
14
src/reader.c
@@ -247,17 +247,19 @@ grammar_rule_check (const symbol_list *r)
|
|||||||
|
|
||||||
/* Check that typed symbol values are used. */
|
/* Check that typed symbol values are used. */
|
||||||
{
|
{
|
||||||
symbol_list *l = r;
|
symbol_list const *l = r;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
for (; l && l->sym; l = l->next, ++n)
|
for (; l && l->sym; l = l->next, ++n)
|
||||||
if (! (l->used
|
if (! (l->used
|
||||||
|| !l->sym->type_name
|
|| !l->sym->type_name
|
||||||
/* The default action, $$ = $1, `uses' both. */
|
/* The default action, $$ = $1, `uses' both. */
|
||||||
|| !r->action && (n == 0 || n == 1)))
|
|| (!r->action && (n == 0 || n == 1))))
|
||||||
if (n)
|
{
|
||||||
warn_at (r->location, _("unused value: $%d"), n);
|
if (n)
|
||||||
else
|
warn_at (r->location, _("unused value: $%d"), n);
|
||||||
warn_at (r->location, _("unset value: $$"));
|
else
|
||||||
|
warn_at (r->location, _("unset value: $$"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user