delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/03/20/14:43:43

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; q=dns; s=default; b=gu2E
Vc9pe0kZx2IGYaLpCZuDfj2klnhWEDGu0qn51xMqws99WcXe441OqOx/75lTiu0+
YOwzIZTVc0xV/9cqjmfcpXKGoROJ1y+IzpfDFtE+5NVJTzUlxuDRkbqpwqflQVU5
YnEidBQ7Dcbh2zUfmZ1y24uKlwPNvo5GlyKfU0o=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; s=default; bh=fUllSu4uCO
skbXh0SxNy7kHjYPQ=; b=B/GGxDpSE7ZAtu+Dvt5Y480XyJBzTuyM/ZilYAgMTr
+95AZ9skfc9MYuzxDZCbWgAKX+v7x2WUw5ELpUsfPpzrGbL564P4mslGp1l5ocye
iL1rYnqQPCiJ9LsHv9bTkGO8xpY3zQSzky+YlS7zmL6/KECyR0SN/qMgf1b7m1/b
U=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Eric
X-HELO: mx1.redhat.com
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2DDAB61BA6
Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake AT redhat DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2DDAB61BA6
Subject: Re: free() and implicit conversion to a function pointer
To: cygwin AT cygwin DOT com
References: <c5af0608-17c4-2270-dbba-c3b704c9226e AT t-online DOT de> <f76885f4-f99f-dc50-2a19-cb892a62db7e AT t-online DOT de>
From: Eric Blake <eblake AT redhat DOT com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Message-ID: <d9b1d7d9-a5bc-13fa-35e7-3b289edb349b@redhat.com>
Date: Mon, 20 Mar 2017 13:43:24 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <f76885f4-f99f-dc50-2a19-cb892a62db7e@t-online.de>
X-IsSubscribed: yes

--JMsNRCTaRDnMdDonfM5t1OfGvO1MsVjVl
Content-Type: multipart/mixed; boundary="2ehJVrqOuQl0xsxvNmFjV6Cd0UWbdJUhX";
 protected-headers="v1"
From: Eric Blake <eblake AT redhat DOT com>
To: cygwin AT cygwin DOT com
Message-ID: <d9b1d7d9-a5bc-13fa-35e7-3b289edb349b AT redhat DOT com>
Subject: Re: free() and implicit conversion to a function pointer
References: <c5af0608-17c4-2270-dbba-c3b704c9226e AT t-online DOT de>
 <f76885f4-f99f-dc50-2a19-cb892a62db7e AT t-online DOT de>
In-Reply-To: <f76885f4-f99f-dc50-2a19-cb892a62db7e AT t-online DOT de>


--2ehJVrqOuQl0xsxvNmFjV6Cd0UWbdJUhX
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 03/16/2017 02:24 PM, Hans-Bernhard Br=C3=B6ker wrote:
>=20
> The reason this is wrong is that C by design treats data and functions
> as living in separate realms, i.e. its virtual machine has a Harvard
> architecture.  One of the consequences of this is that pointers to
> functions and pointers to data are incommensurable, i.e. any and all
> conversions or comparisons across this divide are wrong.  (void *) are
> compatible to all data pointers, but not to function pointers.

That's true of strict C99, but not true of POSIX (which adds the
additional requirements above-and-beyond C99 that NULL be equivalent to
((void*)0) and that any function pointer can be converted to void* and
back without loss of information, in part because of dlsym() and friends).

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--2ehJVrqOuQl0xsxvNmFjV6Cd0UWbdJUhX--

--JMsNRCTaRDnMdDonfM5t1OfGvO1MsVjVl
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJY0CLMAAoJEKeha0olJ0NqG+4H/3gZSbR+fygvxig/UVBSy9IF
W2jM17GlEec7/d306W2VemRYEnRL96D4X8gBXuK1aq/6KUj5t1J5gh37hjGoH1vo
TOWxhAg8CVxX0n6s/W9zdokkhXDSCXyUYLcBW5nM6uH9Vo+32756+OEjmyZlZ3Cz
BnPeNV+5kfPm2cUYkMEFQxOPZr5G5RrhTUlZuVGIvpo9hJ3hIvdm0n5qQ56ajblD
vwIU7OTIC4uzBmU0o/lKTFUggBTHErJjRmyq8rCaVAhzN/85hrDOAj2roFSPPPOv
6ROyyT9Z9spu2mtflgQdwNxENqZau/29/QL09n3TfVod4hH4zoN+DfKayjgNqaI=
=DgFv
-----END PGP SIGNATURE-----

--JMsNRCTaRDnMdDonfM5t1OfGvO1MsVjVl--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019