From owner-freebsd-bugs Mon Sep 28 20:59:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA01252 for freebsd-bugs-outgoing; Mon, 28 Sep 1998 20:59:23 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from mayn.de (airbus.mayn.de [194.95.209.24]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id UAA01247 for ; Mon, 28 Sep 1998 20:59:20 -0700 (PDT) (envelope-from mkb@altair.mayn.de) Received: (qmail 2159 invoked from network); 29 Sep 1998 06:01:10 -0000 Received: from wuff.mayn.de (qmailr@194.95.209.17) by airbus.mayn.de with SMTP; 29 Sep 1998 06:01:10 -0000 Received: (qmail 26863 invoked by uid 5); 29 Sep 1998 03:58:50 -0000 Received: (from mkb@localhost) by altair.mayn.de (8.8.8/8.7.3) id FAA00440; Tue, 29 Sep 1998 05:56:30 +0200 (CEST) From: Matthias Buelow Message-Id: <199809290356.FAA00440@altair.mayn.de> Subject: Re: bin/7742: fclose(3) dumps core on NULL In-Reply-To: <19980928182631.B307@kublai.com> from Brian Cully at "Sep 28, 1998 6:26:31 pm" To: shmit@kublai.com Date: Tue, 29 Sep 1998 05:56:29 +0200 (CEST) Cc: freebsd-bugs@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL47 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Brian Cully wrote: >Why is free(NULL) permissable, but not fclose(NULL)? Because the behaviour of free(NULL) is explicitly defined by ANSI/ISO C. It might be questionable, though, whether fclose(NULL) should really segfault or just report EOF like on other error conditions. However, since many programmers probably don't check the return value of fclose, the segfault perhaps gains more attention to the buggy code. - mkb To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message