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)

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

        "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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to