return value of fprintf

Křištof Želechovski giecrilj at stegny.2a.pl
Mon Jan 22 21:55:33 UTC 2007


The
<http://www.freebsd.org/cgi/man.cgi?query=fprintf&apropos=0&sektion=0&manpat
h=FreeBSD+7-current&format=html> fprintf manual page says it is ANSI C
compatible and it returns the number of characters printed.

The latter is correct: I get printf("abcd") == 4 even under >/dev/full.
(uname is Interix on x86 ver. 3.5)

However, the former is not: according to the ANSI C standard
<http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf> , §7.19.6.1/14,
printf should return a negative value in this case.

I would like to make it a problem report so I send it for public review
first.

Chris



More information about the freebsd-standards mailing list