bug-coreutils
[Top][All Lists]
Advanced

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

Re: POSIX requires checking all *printf return values?!?


From: Eric Blake
Subject: Re: POSIX requires checking all *printf return values?!?
Date: Fri, 19 Oct 2007 11:45:18 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 10/19/2007 11:30 AM:
>> 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?

Which brings up another issue (although it is too late to get this into
the next revision of POSIX) - it would be really nice to have an fseterr()
function.  Here's part of what gnulib had to do in order to write a
POSIX-compliant wrapper around fprintf for broken platforms:

http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/fseterr.c;h=4ca0a34;hb=78da34d

It breaks into the opaque FILE* on platforms where this is possible, but
otherwise, is stuck using a six-syscall workaround just to force a stream
to set its ferror() flag.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHGO0u84KuGfSFAYARAvQZAKCoVaNb7JSU5/pn8ImkZVEmKPnVpgCgsf08
opYJPPcMNwGqgoFyagrUyrI=
=lQ9H
-----END PGP SIGNATURE-----




reply via email to

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