mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
warnings: factoring: complaints
* src/complain.c (error_message): Accept warning categories (an integer) as argument. Location is a 'const location *' instead of 'location *'. (ERROR_MESSAGE): Delete it. * src/complain.c, src/complain.h (complains): New function. (complain, complain_at, complain_at_indent): Generic functions for complaints. Call 'complains'. (warn_at, warn_at_indent, warn, yacc_at, midrule_value_at) (fatal_at, fatal): Delete them. Adjust dependencies. * src/complain.h (enum warnings): New fields 'complaint' and 'fatal'. * bootstrap.conf (XGETTEXT_OPTIONS): Adjust.
This commit is contained in:
committed by
Akim Demaille
parent
d0f11c1b62
commit
6fb8b25619
@@ -773,7 +773,8 @@ add_param (param_type type, char *decl, location loc)
|
||||
}
|
||||
|
||||
if (! name_start)
|
||||
complain_at (loc, _("missing identifier in parameter declaration"));
|
||||
complain_at (loc, complaint,
|
||||
_("missing identifier in parameter declaration"));
|
||||
else
|
||||
{
|
||||
char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
|
||||
@@ -793,7 +794,7 @@ version_check (location const *loc, char const *version)
|
||||
{
|
||||
if (strverscmp (version, PACKAGE_VERSION) > 0)
|
||||
{
|
||||
complain_at (*loc, "require bison %s, but have %s",
|
||||
complain_at (*loc, complaint, "require bison %s, but have %s",
|
||||
version, PACKAGE_VERSION);
|
||||
exit (EX_MISMATCH);
|
||||
}
|
||||
@@ -802,7 +803,7 @@ version_check (location const *loc, char const *version)
|
||||
static void
|
||||
gram_error (location const *loc, char const *msg)
|
||||
{
|
||||
complain_at (*loc, "%s", msg);
|
||||
complain_at (*loc, complaint, "%s", msg);
|
||||
}
|
||||
|
||||
char const *
|
||||
|
||||
Reference in New Issue
Block a user