Bruno Haible <[email protected]> writes:

> Pádraig Brady wrote:
>> > In this case, when confstr (_CS_PATH) is longer than expected,
>> > I would prefer
>> >    - either an abort(),
>
> Recall: abort() is the preferred way for a programmer to say "if this
> situation occurs, I made a mistake, and I want to be notified".
>
>> Best not do that in a lib I think.
>
> Oh, that's the rule that I heard 25 years ago, when working on X11. libX11
> had no single call to abort(). And was libX11 reliable, or was it buggy?
> It was buggy, because when an application never crashes via abort(), only
> via "bad event" or so, users have no way to produce useful bug reports.
>
> GNU libiconv calls abort() in 173 places, and GNU libunistring in 220 places.
> This provides enough incentive for a user to report a malfunction, and
> then I fix the bug. It doesn't happen often, though: only once in a couple
> of years.
>
> So, I'll use abort() here too.

I'd assume any issues that libX11 has (*) would still exist if they had
aborts. I generally agree with Pádraig that it should be avoided in
libraries, but if the situation truly should never happen, then it seems
fine. It is what the "safe" languages often times do.

Anyways, thanks for the Gnulib fix. I'll update Gnulib in coreutils
later, along with adding my test from the original patch.

Collin

(*) I am taking your word for it, I don't know anything at all about
X11, beyond liking SSH forwarding. :)

Reply via email to