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:
Akim Demaille
2012-02-18 19:19:26 +01:00
parent eff97eb54a
commit d0f2b7f856
10 changed files with 18 additions and 11 deletions

View File

@@ -346,8 +346,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;