Re: __attribute__((warn_unused_result)) for NetBSD?

der Mouse <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
>> Why?  IMO Not checking for return value of all these functions as
>> well as close fclose etc. is VERY dangerous.
> Please, explain to me what exactly you intend to do to handle an
> error return from close().

I didn't write that.  But the answer seems pretty obvious: report it to
wherever is appropriate for errors on the file in question.

Typically an error from close() will be something like a delayed-write
I/O error, something the file writer quite likely wants to hear about.

Of course, there also are plenty of uses of close for which the return
value is of no interest whatsoever, such as closing a readonly input
file.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.