Why use (void) func() ?

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Wed Sep 26 16:19:31 AEST 1990


In article <1990Sep25.163906.4187 at zoo.toronto.edu>, henry at zoo.toronto.edu (Henry Spencer) writes:
> For printf, it is usually a whole lot simpler -- in cases where it matters,
> which it often doesn't -- to just check ferror() near the end.

I haven't a copy of the final draft of the C standard.  Does it explicitly
say that errors detected by printf() &co set the stream's error indicator?
I've checked the Plauger & Brodie summary, and it says nothing of the kind,
nor does any of the UNIX manuals that I've checked.  Actually, this is a
long-standing gripe of mine:  I have never been able to find out which
errors printf() *does* detect (negative field width and precision have been
defined as non-errors, but what about %@ or the like), and I've certainly
never seen any suggestion that format errors set ferror() nor any
guarantee that printf() doesn't clear ferror().

What _does_ the standard say about this?

-- 
Fixed in the next release.



More information about the Comp.lang.c mailing list