X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=PfOFTAiegtScFKBmVrkvkqTCG7A9I7Ho/IaCsgMQ1FsHLeHE1r5TA 6fyZlMwWMwfdLkTq2DErrpVAIJo9OBVPmUJ6IU4SWK0jni6+0Q4vQEMNYvX96pA/ RpdtwT3IyZnRl09Z6eBM/Hm0DUMMZuQO7ScPfIPOKvdhMoMFavNi7s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=oP/MDSwcqlyucOodDZTfbEaILG0=; b=wcE530KMCvEegnen/o2RHDyxds7f 9/9EeWd3ZkZPK6TeNBWJbSac84j8kNr3cCShFmWsHZcXccq+2eQh86wIaUg44sMw wGt8SQ/sMHCoz/jAF0GUGz++QOEmYHJEgs2KCpBGpVYxOdye6SfNKbKTB9v4E6wP +O7WvTpMToZcErc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-106.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:3351956, H*MI:sk:3351956, H*f:sk:3351956 X-HELO: drew.franken.de Date: Fri, 17 Mar 2017 09:30:50 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: free() and implicit conversion to a function pointer Message-ID: <20170317083050.GD16777@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <58CB07A8 DOT 9010401 AT tlinx DOT org> <33519566-7f9a-ad78-6160-ccfa6465c279 AT t-online DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J5MfuwkIyy7RmF4Q" Content-Disposition: inline In-Reply-To: <33519566-7f9a-ad78-6160-ccfa6465c279@t-online.de> User-Agent: Mutt/1.8.0 (2017-02-23) --J5MfuwkIyy7RmF4Q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mar 17 00:49, Hans-Bernhard Br=C3=B6ker wrote: > Am 16.03.2017 um 22:46 schrieb L A Walsh: > > Going by subj and talk below, this is a bit confusing... > >=20 > > But it looks like you are testing 'free' for a value? >=20 > Not really. The idea is to test free for _exixtence_. Which only makes > sense in case of weak symbol support getting involved. In other situatio= ns, > there could not possibly be a need for a run-time if() test, because sure= ly > the code could know at build time whether free() exists or not. >=20 > > Isn't standard 'free' declared to take 1 arg and > > return void? >=20 > Yes. But since the code in question doesn't actually _call_ free, that's > both irrelevant. >=20 > > If you aren't talking standard 'free()', then > > nevermind... >=20 > We are talking standard free. More to the point, we're discussing newlib, > the package that actually implements free() for cygwin. >=20 > > > The only code that might actually be a slight bit better than the giv= en > > >=20 > > > if (! free) > > >=20 > > > would be > > >=20 > > > if (0 !=3D free) > > >=20 > > > The function designator `free' auto-decays into a function pointer, > > > which is compared to a null pointer constant: 0. The ! operator does > > > that same thing implicitly, but is fully equivalent to it. > > --- > > Free autodecays to a function pointer? >=20 > In the use case at hand: yes, it does. >=20 > > In what language? >=20 > Standard C. Wasn't that supposed to go to the newlib list where this has been discussed originally? Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --J5MfuwkIyy7RmF4Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYy566AAoJEPU2Bp2uRE+gsjUP+gJ3GgSjZGsHAAPDeDSJROKR Ia76LTbMTLM18M7O8vbtBHY4aQ8EXOzhQB2FPYIn7eYSYN8N7jvWzddybFeMRv8r PHNot1Ug+ZaRNKYdw6qOx0rjH4ZFcznu4IJwlYNZtvCObcih03feCnN606F0iGbN 2d+GX5P9vlQOOgSdQyNjiXHTInBL/dsE9iuHkbYL9UUufmdYpRy477ImxkF3pJ+p CFE/xsbBtEOqyZs5VC2nxiBRwbcPKZPJPc2muyRDvbAiGrgs4iIBg58PM7MteGix UcSur5RB9JpHrkHLRZJoZ1+ACok7xehZlHnvUFCwBWx7tRttKIaBqRoY20RyRlZd VfrDXYK4uyboN1E2IVz5JzB0rQc1ONs/oFoV301QbyzvT90GTn3rUplK4wwP1fpC CHJE0KOBep6/rUsaHoYsR8HYxAVaqHaPBmGka9TsWV01AFbMj7KYikxw/R68DGIT THS6zEYSTgvtpgnzOx8/cClVbXhUoUUVFKambvS3eanRuD/tJJVc6KO5f94xN8My B2y2mDPMgWKnFLTnBiY1d/k7I3SVuyUNCKYbbCBYP8O047cuDcLckAljE07jt52T NW7qTJsc0vmefGKCH3EomhiT1d1byhmGYtuznXlmiDfpMoVmckE4csJw2jWWPb27 HkclFDCynP0qe8xiOX1x =uzac -----END PGP SIGNATURE----- --J5MfuwkIyy7RmF4Q--