bug-gawk
[Top][All Lists]
Advanced

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

Re: Undetected fatal errors from redirected print


From: Miguel Pineiro Jr.
Subject: Re: Undetected fatal errors from redirected print
Date: Tue, 23 Nov 2021 17:31:28 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34

Hi, Andy

On Tue, Nov 23, 2021, at 1:45 PM, Andrew J. Schorr wrote:
> Do you have something in mind?
> Is there a particular usage case that got you in trouble?

I haven't experienced any trouble and I haven't any particular scenario in 
mind. I was just working on nawk and noticed this while surveying how other 
implementations respond to various i/o faults.

>                 /*
>                  * BWK's awk, as far back as SVR4 (1989) would check
>                  * and warn about the status of close.  However, when
>                  * we did this we got too many complaints, so we moved
>                  * it to be under lint control.
>                  */
> I don't know who was complaining or why, so I don't know what the
> counterarguments are. I'm generally in favor of reporting errors, but I
> guess there must be some people who don't like that behavior.
>
> 4. You have the option of running with --lint if you'd like to see more
> warnings, but that may also have its drawbacks.

I understand what you're saying here, but I don't think it's relevant. Gawk is 
silent when a stream fails to close cleanly and I have nothing to say about 
that. The closing of the stream just happens to be where a fatal print error 
(imho) mistakenly becomes benign.

I believe the print output should be flushed before fclose, so that a print 
error can be treated differently from a close error.

Take care,
Miguel



reply via email to

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