From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106737 invoked by alias); 16 Mar 2017 08:40:02 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 106582 invoked by uid 89); 16 Mar 2017 08:40:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=walton, Walton, H*MI:sk:CAH8yC8, H*i:sk:CAH8yC8 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Mar 2017 08:40:00 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D8E9580467 for ; Thu, 16 Mar 2017 08:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D8E9580467 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D8E9580467 Received: from calimero.vinschen.de (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 992715C542 for ; Thu, 16 Mar 2017 08:40:00 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 8077AA805A1; Thu, 16 Mar 2017 09:39:58 +0100 (CET) Date: Thu, 16 Mar 2017 08:40:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: free() and implicit conversion to a function pointer (was: Use of initialized variable in strtod.c) Message-ID: <20170316083958.GC16777@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p2kqVDKq5asng8Dg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017/txt/msg00187.txt.bz2 --p2kqVDKq5asng8Dg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1218 On Mar 15 18:48, Jeffrey Walton wrote: > > But this in __call_atexit.c is definitely correct. It is > > treating free() as a weak symbol and the only way to > > silence Coverity is to add an annotation. > > > > 136 /* Don't dynamically free the atexit array if free is not > > 137 available. */ > > > > CID 175323 (#1 of 1): Function address comparison (BAD_COMPARE) > > func_conv: This implicit conversion to a function pointer is suspicious: > > free. > > Did you intend to call free? > > 138 if (!free) > > 139 break; >=20 > Well, I have not encountered that one (yet). Since Coverity is > complaining about an implicit conversion, maybe the following will > help to avoid the implicit part (and sidestep the finding): >=20 > if (free !=3D NULL) > break; >=20 > Or perhaps: >=20 > if ((void*)free !=3D NULL) > break; >=20 > If that works to clear the finding, then it is one of those items I > write-off as "working and playing well with the tools". Unfortunately you have to tell covreity that "free" is a var, not a functio= n, but since that's not generally true... marking as false positive. Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --p2kqVDKq5asng8Dg Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYyk9eAAoJEPU2Bp2uRE+gZyEP/1k0akNeXx1SGKvQOkSnWB9s WkEf29MvTD6Qdf7vU26fY/aznCaieJqa4dWd9Po2NfghzRDs3JR6v2Y38KmKA3sh CchsiiWKKi2hpSIXRUIIyTTPz/o6K2wBsYX31x4WKGp8lfnN9V87IRb4YPTQ8vut 0yg+lquvuaHgVLlKr88eCmagJhiR+2zHREbUNbqdC8iM9l2d6so/KIZG58dHHaAI Ah1wZWg1Gf68TGjnNOsAnZjq/XRM1QYy6xu9nJneu2hfVid9WWKTI2IH3J0YKbNN ON4ahmyBuKj6JHWdOZE/bgHtBHFQwfl8jH0uiVcV3Zqm+c+VRLG/h839hgKnkYzh eCWLayvhTEdg6jY8PUkVzYvF6Aj7bWsC1Qnraurjewy4i0pG+890S9bMJDHomhEF x/qwZM/laNPcKfBhJ2rNZX15Sxap+FHBceFiPqdCxZnoC+waLMVNC5i2eX9z/+J3 ZwtWwmmxevr5AM++BoGuOKRE7Ow5kpWtDyhUhxx66jD5ah8Xlg3ZOccu+nuCS1PA 4kTv+dEMkZiUmbm3Ijs9JoZKXfN3aN3bL15jAsFfLZR2dCIT7m8sKadmDck5t6bi b9QX2v12ToaDmc9Z+idoNfBMhE8kJgLjHVTBJd/2593f+uVxTPCMHX/C1GP7bf6W 63aaFfioIun9MxAxWFwO =605w -----END PGP SIGNATURE----- --p2kqVDKq5asng8Dg--