[rfc] add __FILE__ and __LINE__ to internal_error()

J.T. Conklin jtc@redback.com
Mon Dec 4 11:34:00 GMT 2000


>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> This is part one of a two step process to completly eliminate all
Andrew> remaining abort() calls in GDB.
Andrew> Part two involves replacing abort() with ``internal_error (__FILE__,
Andrew> __LINE__, "legacy call to abort()");''.
Andrew>
Andrew> Look ok?

While I can appreciate the need to uniquely identify a specific call
to internal_error(), one thing I don't care for is how __FILE__ and
__LINE__ are added to each call.  I think it clutters things up more
than is necessary.

Unfortunately, without requiring gcc or C9X, we can't use macros with
variable argument lists.  Otherwise, I would recommend that internal-
error() and internal_verror() be macros that expand __FILE__ and __LINE__
before calling "real" functions under the hood.

So given that there aren't really any viable alternatives, I'm OK with
this.

        --jtc

-- 
J.T. Conklin
RedBack Networks


More information about the Gdb-patches mailing list