mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
maint: avoid "magic number exit".
* cfg.mk (local-checks-to-skip): No longer skip it. * bootstrap.conf (gnulib_modules): Add sysexits. * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, * src/system.h, tests/calc.at, tests/named-refs.at: Use assert where appropriate instead of "if (...) exit". Use symbolic exit status elsewhere.
This commit is contained in:
@@ -528,9 +528,8 @@ yylex (void)
|
||||
static int
|
||||
power (int base, int exponent)
|
||||
{
|
||||
assert (0 <= exponent);
|
||||
int res = 1;
|
||||
if (exponent < 0)
|
||||
exit (3);
|
||||
for (/* Niente */; exponent; --exponent)
|
||||
res *= base;
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user