From owner-freebsd-current Wed Sep 9 04:59:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA00688 for freebsd-current-outgoing; Wed, 9 Sep 1998 04:59:26 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA00682 for ; Wed, 9 Sep 1998 04:59:24 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id VAA22245; Wed, 9 Sep 1998 21:59:10 +1000 Date: Wed, 9 Sep 1998 21:59:10 +1000 From: Bruce Evans Message-Id: <199809091159.VAA22245@godzilla.zeta.org.au> To: cracauer@cons.org, current@FreeBSD.ORG Subject: Re: Regarding fclose(NULL) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >I plan to change fclose so that it doesn't dump core on fclose(NULL). Aargh, no. >For reasoning and actual patch see PR bin/7742. I thought it was too obviously wrong to comment. "Fixing" fclose(NULL) has only slightly less negative worth than "fixing" strlen(NULL). Careful programmers won't call fclose() with a NULL arg, since that gives undefined behaviour, so they won't benefit from the change. Careless programmers won't check that fclose() succeeds, so they will get a negative benefit (loss of the core dump). The man page is not incomplete. It says that fclose() works on streams. NULL is not a stream. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message