Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2000 14:11:46 +0900
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        Robert Nordier <rnordier@nordier.com>, hackers@FreeBSD.ORG
Subject:   Re: fclose vs ferror (from libc/getcap)
Message-ID:  <3A1B5592.89A7BBE2@newsguy.com>
References:  <200011201020.MAA23349@siri.nordier.com> <p04330104b640abfaf13d@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
Garance A Drosihn wrote:
> 
> The "single Unix spec" says:
>       After the call to fclose(), any use of stream causes
>       undefined behavior.
> 
> FreeBSD's own man page for fclose says:
>       [fclose returns 0 or EOF].  In either case, no further
>       access to the stream is possible.
> 
> Neither of those indicate that anyone should "expect it to
> work", no matter what language they are programming in.  There
> is nothing in the description for ferror which implies that it
> is some magical exception to the above rules.

Undefined behavior means anything goes. On a standard, it means the
behaviour is implementation-defined (which may be undefined or not).

And notice that ferror() is not an access to the stream.

-- 
Daniel C. Sobral			(8-DCS)

dcs@newsguy.com
dcs@freebsd.org
capo@united.bsdconspiracy.net

	"All right, Lieutenant, let's see what you do know. Whatever it is,
it's not enough, but at least you haven't done anything stupid yet."
	"I've hardly had time, sir."
	"There's a naive statement."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A1B5592.89A7BBE2>