mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
introduced a GCC-like -Werror=type
* src/complain.h : errors_flag variable * src/complain.c : actual stuff happens here * src/conflits.c : differentiated SR and RR conflicts * src/getargs.c : flags_argmatch recognizes the new -Werror format
This commit is contained in:
committed by
yro3ht
parent
47f6a236ec
commit
981c53e257
@@ -83,31 +83,63 @@ flags_argmatch (const char *option,
|
||||
int all, int *flags, char *args)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
args = strtok (args, ",");
|
||||
|
||||
/* Not sure whether we should keep this : -Werror=no-bar */
|
||||
int no = STRPREFIX_LIT ("no-", args) ? 3 : 0;
|
||||
args += no;
|
||||
int value = 0;
|
||||
|
||||
while (args)
|
||||
{
|
||||
args = strtok (args, ",");
|
||||
while (args)
|
||||
int err = STRPREFIX_LIT ("error", args);
|
||||
if (err)
|
||||
args += (args[5] == '=') ? 6 : 5;
|
||||
|
||||
if (!err || args[-1] == '=')
|
||||
value = XARGMATCH (option, args, keys, values);
|
||||
if (value == 0)
|
||||
{
|
||||
if (no)
|
||||
{
|
||||
int no = STRPREFIX_LIT ("no-", args) ? 3 : 0;
|
||||
int value = XARGMATCH (option, args + no, keys, values);
|
||||
if (value == 0)
|
||||
{
|
||||
if (no)
|
||||
*flags |= all;
|
||||
else
|
||||
*flags &= ~all;
|
||||
}
|
||||
if (err)
|
||||
/* Using &= ~all activates complaint, silent and fatal */
|
||||
errors_flag = Wnone;
|
||||
else
|
||||
{
|
||||
if (no)
|
||||
*flags &= ~value;
|
||||
else
|
||||
*flags |= value;
|
||||
}
|
||||
args = strtok (NULL, ",");
|
||||
*flags |= all;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (err)
|
||||
errors_flag |= all;
|
||||
else
|
||||
*flags &= ~all;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (no)
|
||||
{
|
||||
if (err)
|
||||
errors_flag &= ~value;
|
||||
else
|
||||
*flags &= ~value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (err)
|
||||
{
|
||||
errors_flag |= value;
|
||||
warnings_flag |= value;
|
||||
}
|
||||
else
|
||||
*flags |= value;
|
||||
}
|
||||
}
|
||||
args = strtok (NULL, ",");
|
||||
}
|
||||
else
|
||||
*flags |= all;
|
||||
}
|
||||
}
|
||||
|
||||
/** Decode a set of sub arguments.
|
||||
|
||||
Reference in New Issue
Block a user