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.

Conflicts:

	doc/bison.texinfo
	src/parse-gram.y
This commit is contained in:
Akim Demaille
2012-02-18 19:19:26 +01:00
parent 24bb5f8fb7
commit dd5611579b
10 changed files with 20 additions and 13 deletions

View File

@@ -347,8 +347,7 @@ static int
power (int base, int exponent)
{
int res = 1;
if (exponent < 0)
exit (3);
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;

View File

@@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# FIXME: Duplication with calc.at.
AT_BANNER([[Named references tests.]])
AT_SETUP([Tutorial calculator])
@@ -142,8 +143,7 @@ int yylex (void)
static int power (int base, int exponent)
{
int res = 1;
if (exponent < 0)
exit (3);
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;