Bruno Haible | 3 Aug 2004 19:13

Re: `fatal' module problem?

Simon Josefsson wrote:
> But error doesn't take a va_list, from error.h:

Agreed. We don't have a va_error(), and since the purpose of the error()
module is to provide for a substitute for functions already in glibc,
we cannot add it either.

Can you either
  - use a simplified version of error_tail in fatal.c, or
  - drop the 'fatal' module entirely (none of coreutils, tar, diff, gettext
    uses it)?

Bruno
Simon Josefsson | 3 Aug 2004 19:27

Re: `fatal' module problem?

Bruno Haible <bruno <at> clisp.org> writes:

> Simon Josefsson wrote:
>> But error doesn't take a va_list, from error.h:
>
> Agreed. We don't have a va_error(), and since the purpose of the error()
> module is to provide for a substitute for functions already in glibc,
> we cannot add it either.
>
> Can you either
>   - use a simplified version of error_tail in fatal.c, or
>   - drop the 'fatal' module entirely (none of coreutils, tar, diff, gettext
>     uses it)?

I realized `error (EXIT_FAILURE, ...)' did what I want, so I went for
your second option.

(I kind of preferred `fatal (...)' as it is more readable, though.)

Unless fatal.* is fixed, perhaps removing the 'modules/fatal' file is
a good idea, so others don't fall in the same trap as I did.

Thanks,
Simon
Paul Eggert | 3 Aug 2004 20:44
Favicon

Re: Re: `fatal' module problem?

Simon Josefsson <jas <at> extundo.com> writes:

> (I kind of preferred `fatal (...)' as it is more readable, though.)

Another advantage of "fatal" would be that GCC can deduce that it
doesn't return, and can generate better code in some cases.

> Unless fatal.* is fixed, perhaps removing the 'modules/fatal' file is
> a good idea, so others don't fall in the same trap as I did.

OK, I removed the "fatal" module's files.  That's good enough for now.

Gmane