[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POSIX requires checking all *printf return values?!?
From: |
Bruce Korb |
Subject: |
Re: POSIX requires checking all *printf return values?!? |
Date: |
Mon, 22 Oct 2007 13:40:29 -0700 |
On 10/19/07, Jim Meyering <address@hidden> wrote:
> > Personally, I would LOVE for the stream error indicator to be reliable
> > after [f]printf failures, even in the face of errors unrelated to
> > fputc()-style actions. But I don't see that required in the standards,
> > and this thread was started by a libc implementation that did just that -
> > returned -1 for ENOMEM without adjusting ferror(). Is it worth changing
> > POSIX to require ferror() to be reliably set? Or is it at least worth
>
> How about *allowing* ferror to be reliably set?
If you can't rely on it, then you can't rely on it and you need to wrap all
*printf calls with excruciatingly correct error condition tests. Programmers
have learned that you check ferror() for problems. Now saying that it is
merely "a mostly complete cover" of error conditions basically says it
does not work. The next rev of C should correct the oversight.
Old (current) environments need the extra code. Thanks - Bruce
- Re: printf produces no output for %f directive, (continued)
- Re: printf produces no output for %f directive, Jim Meyering, 2007/10/19
- Re: printf produces no output for %f directive, Jim Meyering, 2007/10/19
- POSIX requires checking all *printf return values?!?, Jim Meyering, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Pádraig Brady, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Jim Meyering, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Andreas Schwab, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Eric Blake, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Jim Meyering, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Eric Blake, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Nick Stoughton, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?,
Bruce Korb <=
- Re: printf produces no output for %f directive, Pádraig Brady, 2007/10/19
- Re: printf produces no output for %f directive, Jim Meyering, 2007/10/19