From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 1 07:45:10 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 598D21065670; Wed, 1 Jun 2011 07:45:10 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id F10A08FC18; Wed, 1 Jun 2011 07:45:08 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMGAL3k5U1bsdSL/2dsb2JhbABTmA+OEXjGYYYgBJ99 Received: from 139.212-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.212.139]) by relay.skynet.be with ESMTP; 01 Jun 2011 09:15:49 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id p517FmkN002636; Wed, 1 Jun 2011 09:15:48 +0200 (CEST) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: freebsd-hackers@freebsd.org Date: Wed, 1 Jun 2011 09:14:54 +0200 User-Agent: KMail/1.13.6 (FreeBSD/9.0-CURRENT; KDE/4.6.2; i386; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart62236387.rDRI1Qijmq"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201106010915.46113.tijl@coosemans.org> Cc: mdf@freebsd.org, Bruce Evans Subject: Re: sizeof(function pointer) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2011 07:45:10 -0000 --nextPart62236387.rDRI1Qijmq Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Wednesday 01 June 2011 01:07:29 mdf@freebsd.org wrote: > I am looking into potentially MFC'ing r212367 and related, that adds > drains to sbufs. The reason for MFC is that several pieces of new > code in CURRENT are using the drain functionality and it would make > MFCing those changes much easier. >=20 > The problem is that r212367 added a pointer to a drain function in the > sbuf (it replaced a pointer to void). The C standard doesn't > guarantee that a void * and a function pointer have the same size, > though its true on amd64, i386 and I believe PPC. What I'm wondering > is, though not guaranteed by the standard, is it *practically* true > that sizeof(void *) =3D=3D sizeof(int(*)(void)), such that an MFC won't > break binary compatibility for any supported architecture? It's guaranteed by POSIX. http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html Section 2.12.3 --nextPart62236387.rDRI1Qijmq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iF4EABEIAAYFAk3l5yEACgkQfoCS2CCgtit8zQD/bq4ydYnWmKyewxO98ZhUqBED Ap9pJMIPywB7NGcpekgA/1zWORGnd9dsQHvZP7mrfEFoRCr3v0FwA0c7HqPsGCvY =5Uib -----END PGP SIGNATURE----- --nextPart62236387.rDRI1Qijmq--