Subject: Re: Is fclose(NULL) defined?
To: None <current-users@NetBSD.ORG>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 09/12/1995 15:09:47
> If fclose() accepts NULL and just returns, then some might say that it
> was shirking it's duty by not pointing out a programmer error, but
> others would say that it's just good defensive programming.

Not only that, but the code which called it still is unlikely to behave
correctly, since it has presumably been blundering about thrusting nonsense
pointers at other stdio functions :-).  More interestingly, should a future
ANSI standard decree that fclose(NULL) gain some useful meaning (like, perhaps,
"close all fopened FILE pointers"), these programs whose ill behavior has
been silently tolerated will now misfire badly in a way the library is
obligated not to diagnose.