This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc] add __FILE__ and __LINE__ to internal_error()
- To: jtc at redback dot com
- Subject: Re: [rfc] add __FILE__ and __LINE__ to internal_error()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 05 Dec 2000 09:37:54 +1100
- Cc: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- References: <3A2789DD.ABA82A16@cygnus.com> <5mzoicc75w.fsf@jtc.redback.com>
"J.T. Conklin" wrote:
> 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.
I'll strongly concure with this sentiment. I've used systems (1) that
have tried to hide the passing of __FILE__ and __LINE__ while still
supporting varargs. Those experiences led me to conclude that while
having explicit __FILE__ and __LINE__ arguments was a pain, it was far
less of a pain then trying to set up and then get people to consistently
use convoluted macros that did the same thing.
The only pratical alternative I could think of was to drop varargs from
internal_error().
Andrew