Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2011 09:14:54 +0200
From:      Tijl Coosemans <tijl@coosemans.org>
To:        freebsd-hackers@freebsd.org
Cc:        mdf@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: sizeof(function pointer)
Message-ID:  <201106010915.46113.tijl@coosemans.org>
In-Reply-To: <BANLkTimctcBWRrYVLyc-WLgePyCXqaPTGA@mail.gmail.com>
References:  <BANLkTimctcBWRrYVLyc-WLgePyCXqaPTGA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106010915.46113.tijl>