mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
parser: warn about hexadecimal token numbers in Yacc mode
* src/scan-gram.l (scan_integer): Warn. * tests/input.at (Yacc warnings on symbols): Check.
This commit is contained in:
@@ -846,6 +846,10 @@ static unsigned long
|
||||
scan_integer (char const *number, int base, location loc)
|
||||
{
|
||||
verify (INT_MAX < ULONG_MAX);
|
||||
if (base == 16)
|
||||
complain (&loc, Wyacc,
|
||||
_("POSIX Yacc does not support hexadecimal literals"));
|
||||
|
||||
unsigned long num = strtoul (number, NULL, base);
|
||||
|
||||
if (INT_MAX < num)
|
||||
|
||||
Reference in New Issue
Block a user