cpplib shouldn't be calling abort [patch]

Per Bothner bothner@cygnus.com
Tue Apr 13 12:24:00 GMT 1999


> It appears to be a design feature of cpplib that it never calls
> abort.  (See the commentary above cpp_fatal, for example.)

You misunderstand.  There is a distinction between "fatal errors",
which happen when the *input* is so messed-up that there is little
point in continuing, and "aborts", which happen when the *program*
is so confused (due to a bug in the program) that there is
little point in continuing.  If abort or exit is called, it
is the same as a segfault:  A bug in cpplib, which we should fix.
(One might reasonably have calls to abort or exit where a program
invariant is violated.)

The point is that *erroneous input* must never call exit or abort,
however messed up it is.  For example, cpplib might be integrated
into an IDE, which should never shut down because a source file
has a syntax error, even if the file is complete garbage (like
/dev/random)!

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner


More information about the Gcc-patches mailing list