warnings: fusion of complain and complain_at

These functions are very similar, and keeping them seperate makes
future improvements difficult, so merge them.

This impacts 89 calls.

* src/bootstrap.conf: Adjust.
* src/complain.c (complain, complain_at): Merge into...
(complain): this.
(complain_args): Adjust.
* src/complain.h, src/conflicts.c, src/files.c, src/getargs.c,
* src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y,
* src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l,
* src/scan-skel.l, src/symlist.c, src/symtab.c:
Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
This commit is contained in:
Theophile Ranquet
2012-10-01 13:44:20 +00:00
committed by Akim Demaille
parent a49f4904c3
commit bb8e56ff67
19 changed files with 161 additions and 179 deletions

View File

@@ -186,7 +186,7 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$"
BEGIN SC_LINE_COMMENT;
}
[$@] {
complain_at (*loc, Wother, _("stray '%s'"), yytext);
complain (loc, Wother, _("stray '%s'"), yytext);
obstack_escape (&obstack_for_string, yytext);
need_semicolon = true;
}
@@ -225,10 +225,8 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$"
if (outer_brace && !yacc_flag && language_prio == default_prio
&& skeleton_prio == default_prio && need_semicolon && ! in_cpp)
{
complain_at (*loc, Wdeprecated,
_("a ';' might be needed at the end of action code"));
complain_at (*loc, Wdeprecated,
_("future versions of Bison will not add the ';'"));
complain (loc, Wdeprecated, _("a ';' might be needed at the end of action code"));
complain (loc, Wdeprecated, _("future versions of Bison will not add the ';'"));
obstack_1grow (&obstack_for_string, ';');
}
@@ -499,8 +497,8 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
return num;
else
{
complain_at (text_loc, complaint, _("integer out of range: %s"),
quote (text));
complain (&text_loc, complaint, _("integer out of range: %s"),
quote (text));
return INVALID_REF;
}
}
@@ -673,8 +671,8 @@ fetch_type_name (char *cp, char const **type_name,
'text' is needed for error messages. */
++cp;
if (untyped_var_seen)
complain_at (dollar_loc, complaint,
_("explicit type given in untyped grammar"));
complain (&dollar_loc, complaint,
_("explicit type given in untyped grammar"));
tag_seen = true;
}
return cp;
@@ -732,15 +730,15 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
if (union_seen | tag_seen)
{
if (rule->midrule_parent_rule)
complain_at (dollar_loc, complaint,
complain (&dollar_loc, complaint,
_("$$ for the midrule at $%d of %s"
" has no declared type"),
rule->midrule_parent_rhs_index,
quote (effective_rule->content.sym->tag));
else
complain_at (dollar_loc, complaint,
_("$$ of %s has no declared type"),
quote (rule->content.sym->tag));
complain (&dollar_loc, complaint,
_("$$ of %s has no declared type"),
quote (rule->content.sym->tag));
}
else
untyped_var_seen = true;
@@ -761,9 +759,9 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
if (!type_name)
{
if (union_seen | tag_seen)
complain_at (dollar_loc, complaint,
_("$%s of %s has no declared type"), cp,
quote (effective_rule->content.sym->tag));
complain (&dollar_loc, complaint,
_("$%s of %s has no declared type"), cp,
quote (effective_rule->content.sym->tag));
else
untyped_var_seen = true;
}