From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29046 invoked by alias); 1 Mar 2018 13:29:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42414 Received: (qmail 15229 invoked by uid 1010); 1 Mar 2018 13:29:21 -0000 X-Qmail-Scanner-Diagnostics: from mail-oln040092000097.outbound.protection.outlook.com (unknown@mail-oln040092000097.outbound.protection.outlook.com) by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(40.92.0.97):SA:0(-1.9/5.0):. Processed in 2.336578 secs); 01 Mar 2018 13:29:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS, T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: krokodileglue@outlook.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oDNpNUI5FIvaZlJV01J9jJtrHGz5qh5Pga5pWh3IfEc=; b=L7yOfSxY0dUmQOwjNk+bGkNqXv8HBxo9n3s8qT/u9oOy4Cw79BTx+piwOqMhdHNOERtDtfY2puU/xPFVXMpKaa/lF9mrKv2Ls4NBTDZeyKBvCEm2mvso/70IZ2Y+LInS9uxlm+E1UxqpYJW7n+kWUXtUnERNGaL3EPbEd/RQI4XOn/Vi58lzjHaqQ0yiAGgCLGw1TyJNGrfQ8Fckhh6f/vVQksyTPXLOPbXFuZyTuvo5jZuPNGouHIAdGJxgmvkvTvwff9GiRFmQPHdV023BFTQzGEzEFt3zlcTlG0/jkLXsoszjEWmZcul8oNbmxqvCjeAZazjU/c87rWjlq9Yk4g== From: Taylor West To: Peter Stephenson , "zsh-workers@zsh.org" Subject: Re: [PATCH] remove unnecessary checks for NULL in zfree and zsfree Thread-Topic: [PATCH] remove unnecessary checks for NULL in zfree and zsfree Thread-Index: AQHTsPrO5gNXQaJqDUyao2SqzTE4qaO6k/bIgACFrYCAAEQeFg== Date: Thu, 1 Mar 2018 13:29:13 +0000 Message-ID: References: ,<20180301091511.40f12304@pwslap01u.europe.root.pri> In-Reply-To: <20180301091511.40f12304@pwslap01u.europe.root.pri> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:0F1F71A6F4A02EB6FB30B1E20EB63FACADA2D0DCC60D29EC5C33DF780648628E;UpperCasedChecksum:629C0C61F51DC21EA1F6DEF21D62ED6FC7C9C9CF217BA74091CE7A1EA70F2883;SizeAsReceived:7286;Count:45 x-tmn: [il2YDExXaCLdj6PQj0rOU2YEdE7pVbiW] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN3NAM01HT217;6:Ds6yqreM0uFArBoIiqOINMBVFJsqiAtD2IIA0bMXd5XKKOtw4/HS7qpnWX/E/x9mCWfUKCK6+1EzitAX5CWJStP4Y1643Mh4O014YwTGxqEtavY6I5YDdvMf6rYkmZ/2bEF59yefOTzmc/l76GBs/Cp2GbwkqclfLJiyoXf4Lqo4rOwaIMg1m30Wt6TncUHMnQMq0tCdiqhxLdVmdQg+cPRU9+rAQ+CGJHuZT0dVAdPgOrpuPTUEDTJQBMfo0UIlb/aV1j3aRM5f+yUbSEgjDh3fNwuctgtBBZWFxHp+vXcsFLmSPMB5zjYLDqn8NS0qM9NawN2oCN4yTzizanzwWFPVLEepYVrsbhgJrQXAvRo=;5:xnbtA13s39z1SxWRFfbk+a7utoxBKVVzi/eD/Bpj92+dTluKlpUpzcz7tYKXFHk/wrXZ+OKSGrvAE8QSUJvDqOwRN/yGFlX1tWItVkjt1J03BCcwdQXBKkMjo/5xzXl+qfcEk+oOVvknJAiIx92QZ5HbZ0vpOCzCxxdWi+flZsk=;24:76adDUvQ0OBUWs6yIipg+NRZiGKyLSkrYjKxRp/+X7STTfE48fiManw5sI7haCYu4BuYuelwFEu2FFJqCjJii5ZWsOvWFx73R9MHH54gHw8=;7:+MbKFLT4qZUNzThOli6MupX+tX6xdIrkHy46mcVA+NWdoeCOu/RD4i0FcFAIYDFea9jXMtC92aAYS/aTvz/bDEKI41xkhlzlFhYUW4NbelVAAIjFLrkaTOqzKbNYop8NUd8aGiH2RrPv2VCwMdP1aTy2HiSBfyevtvmTVMVLTbkL1ICGnH/foAd7v0rEApgRrLfcqn6Gc5dsdnfMnndqKeLL0RDmXKWyVURb0hUuSwnvjLJWXrRvJsBeg/A0uiVf x-incomingheadercount: 45 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045);SRVR:BN3NAM01HT217; x-ms-traffictypediagnostic: BN3NAM01HT217: x-ms-office365-filtering-correlation-id: 60055a95-7112-4e92-3589-08d57f786cc3 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:BN3NAM01HT217;BCL:0;PCL:0;RULEID:;SRVR:BN3NAM01HT217; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:BN3NAM01HT217;H:BY2PR06MB2277.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY2PR06MB22774711E031763A2245D51BB1C60BY2PR06MB2277namp_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60055a95-7112-4e92-3589-08d57f786cc3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 13:29:13.9547 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM01HT217 --_000_BY2PR06MB22774711E031763A2245D51BB1C60BY2PR06MB2277namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I quoted the C11 standard because it's the one I'm most familiar with, but = that particular clause has been present since the first ANSI draft. In the = C89 standard it's section 4.10.3.2: ``If ptr is a null pointer, no action o= ccurs.'' Even if zsh were to rely on some variant of GNU C, no extension th= at I know of modifies this part of the standard. Unless you know of a parti= cular platform with a particularly bad compiler that you want to support, I= recommend taking advantage of these kinds of guarantees. ________________________________ From: Peter Stephenson Sent: Thursday, March 1, 2018 1:15 AM To: zsh-workers@zsh.org Subject: Re: [PATCH] remove unnecessary checks for NULL in zfree and zsfree On Thu, 1 Mar 2018 01:17:12 +0000 Taylor West wrote: > According to section 7.22.3.3 paragraph 2 of the final committee draft > of the C11 standard, if free() is passed a NULL pointer then "no > action occurs". The current checks on `p' in zfree and zsfree are > unnecessary---this patch removes them. We haven't even progressed to C99 yet... zsh is designed to be defensive about some pretty old stuff. Unfortunately, it's quite difficult to know when where it's still being compiled. pws --_000_BY2PR06MB22774711E031763A2245D51BB1C60BY2PR06MB2277namp_--