bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] invalid use of errno after ferror


From: Bruno Haible
Subject: Re: [Bug-gnulib] invalid use of errno after ferror
Date: Mon, 22 Sep 2003 12:55:25 +0200
User-agent: KMail/1.5

Paul Eggert wrote:
> Sorry, I don't understand this point.  If you can assume POSIX and
> C89 or better, why can't you write this?
>
>   if (printf ("foo") < 0)
>     return -1;
>
> That is, you needn't write a macro; just write the code inline.

If the number of lines of code increases by 100% due to pedantic error
handling, the code is repelling. Think of applying this technique to
all usage() functions and all other output functions. *shudder*

> There are other ways to solve the problem, that don't involve either
> macros or lots of 'if (...) return -1's in the code.  For example, we
> could define our own structure that contains a FILE * pointer and an
> errno value, and use that structure for all stream output.  Or, if
> that's too intrusive, we could have a hash table, indexed on FILE *
> value, that records the failing errno.

I find this too intrusive as well. What do the others think?

Bruno





reply via email to

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