From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115261 invoked by alias); 20 Mar 2017 18:45:31 -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 115134 invoked by uid 89); 20 Mar 2017 18:45:22 -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= 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; Mon, 20 Mar 2017 18:45:21 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 435D561D02; Mon, 20 Mar 2017 18:45:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 435D561D02 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@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 435D561D02 Received: from [10.10.121.124] (ovpn-121-124.rdu2.redhat.com [10.10.121.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3C0862922; Mon, 20 Mar 2017 18:45:19 +0000 (UTC) Subject: Re: Fwd: Re: free() and implicit conversion to a function pointer (was: Use of initialized variable in strtod.c) To: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= , newlib@sourceware.org References: <5952177e-aff7-2653-8977-3295524fdb03@t-online.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: Date: Mon, 20 Mar 2017 18:45:00 -0000 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: <5952177e-aff7-2653-8977-3295524fdb03@t-online.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qGHr1m7rfBicE7hawQO7GkVIaCCPrMPIq" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00199.txt.bz2 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qGHr1m7rfBicE7hawQO7GkVIaCCPrMPIq Content-Type: multipart/mixed; boundary="KwhKx69pc3DsI3i0x8bAOHdc4hUPhm6e6"; protected-headers="v1" From: Eric Blake To: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= , newlib@sourceware.org Message-ID: Subject: Re: Fwd: Re: free() and implicit conversion to a function pointer (was: Use of initialized variable in strtod.c) References: <5952177e-aff7-2653-8977-3295524fdb03@t-online.de> In-Reply-To: <5952177e-aff7-2653-8977-3295524fdb03@t-online.de> --KwhKx69pc3DsI3i0x8bAOHdc4hUPhm6e6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1077 On 03/17/2017 04:04 PM, Hans-Bernhard Br=C3=B6ker wrote: > 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). Then again, not all newlib targets aim for POSIX compliance, and it is entirely feasible that someone is trying to use newlib to achieve C99 compliance without caring about additional POSIX requirements. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KwhKx69pc3DsI3i0x8bAOHdc4hUPhm6e6-- --qGHr1m7rfBicE7hawQO7GkVIaCCPrMPIq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----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/ iQEcBAEBCAAGBQJY0CM+AAoJEKeha0olJ0Nqy0cH/ijUYPPM+QZotT/AjXRjjegH T2YAK7e3owKOb6gUsWFU5nUEVjcDajdL7jZWm2S0r6r/QFbrHFW6Ec+5ORblGb0I Ur/xSRH8pBtTg9UzuNsJa3sP03PHv8h+9sRk9e6xEmmnhvFBu2qEdMi3ByeKFhkh 47uAXLfAFs9ZJ9o7EX1WhuTWYvHU2Fu+NZ5TGJ/DIglYeLJS1yahQky/ttk/wFgL +rxWAo4c03bS8B7qgVDkFQ1zqqd/BOydTIYizMojYFXjbihlmx0Hn99zrfcInAzs Igvrrt08zBT/rVCR6XVXhFS4s1gxWNBQpT6vfJVvJedL9SxA+j8eeE9k0YuJV1U= =LtV2 -----END PGP SIGNATURE----- --qGHr1m7rfBicE7hawQO7GkVIaCCPrMPIq--