mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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. Conflicts: doc/bison.texinfo src/parse-gram.y
This commit is contained in:
@@ -9366,8 +9366,8 @@ calcxx_driver::scan_begin ()
|
||||
yyin = stdin;
|
||||
else if (!(yyin = fopen (file.c_str (), "r")))
|
||||
@{
|
||||
error (std::string ("cannot open ") + file);
|
||||
exit (1);
|
||||
error (std::string ("cannot open ") + file + ": " + strerror(errno));
|
||||
exit (EXIT_FAILURE);
|
||||
@}
|
||||
@}
|
||||
|
||||
@@ -10045,11 +10045,17 @@ yyparse (char const *file)
|
||||
{
|
||||
yyin = fopen (file, "r");
|
||||
if (!yyin)
|
||||
exit (2);
|
||||
{
|
||||
perror ("fopen");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
/* One token only. */
|
||||
yylex ();
|
||||
if (fclose (yyin) != 0)
|
||||
exit (3);
|
||||
{
|
||||
perror ("fclose");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user