[Top][All Lists]
[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
- Re: [Bug-gnulib] invalid use of errno after ferror, (continued)
- Re: [Bug-gnulib] invalid use of errno after ferror, Paul Eggert, 2003/09/15
- Re: [Bug-gnulib] invalid use of errno after ferror, Jim Meyering, 2003/09/16
- Re: [Bug-gnulib] invalid use of errno after ferror, Bruno Haible, 2003/09/17
- Re: [Bug-gnulib] invalid use of errno after ferror, Jim Meyering, 2003/09/17
- Re: [Bug-gnulib] invalid use of errno after ferror, Paul Eggert, 2003/09/17
- Re: [Bug-gnulib] invalid use of errno after ferror, Bruno Haible, 2003/09/18
- Re: [Bug-gnulib] invalid use of errno after ferror, Paul Eggert, 2003/09/18
- Re: [Bug-gnulib] invalid use of errno after ferror, Bruno Haible, 2003/09/19
- Re: [Bug-gnulib] invalid use of errno after ferror, Paul Eggert, 2003/09/22
- Re: [Bug-gnulib] invalid use of errno after ferror,
Bruno Haible <=