bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] do not ignore errors like ENOSPC, EIO when writing to stdout


From: Jim Meyering
Subject: Re: [PATCH] do not ignore errors like ENOSPC, EIO when writing to stdout
Date: Mon, 30 Jan 2012 11:43:20 +0100

Akim Demaille wrote:
> Le 29 janv. 2012 à 21:18, Jim Meyering a écrit :
>
>>> For my education: why not closing stderr too?  Sure, it's
>>> then hard to decide where to send the error message, but at least
>>> the exit status would change.
>>
>> If we're writing anything to stderr, it's probably because
>> there's already been some error (why else write to stderr?),
>
> There can be warnings send to stderr too.  Or logs
> if some verbose mode is activated.
>
>> and thus the exit status will already be nonzero.
>>
>> There might be a case for it in bison, though, if it generates
>> non-diagnostics to stderr.
>
> They are diagnostics, but not hard errors.  And anyway, as the
> point is safety, I just wondered what's the point of closing
> stdout only, and not both stdout and stderr in every single
> program, just for regularity.
>
> Sure, what is sent to stdout is certainly more important than
> stderr, but while at it...

Hi Akim,

So are these soft diagnostics important enough that their loss
(due to failed write-to-stderr) would merit inducing a nonzero
exit status?  Hey! I know... exit (0.5) :-)

But seriously, I suppose a patch (maybe even a new gnulib module --
I haven't looked) would be welcome solely on principle.  Probably via
an atexit-callable function very similar to close_stdout.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]