From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpGQS-0006oz-OX for qemu-devel@nongnu.org; Thu, 22 Oct 2015 10:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpGQN-0007v3-NB for qemu-devel@nongnu.org; Thu, 22 Oct 2015 10:01:04 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:35426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpGQN-0007uz-FQ for qemu-devel@nongnu.org; Thu, 22 Oct 2015 10:00:59 -0400 Received: by lfbn126 with SMTP id n126so14724030lfb.2 for ; Thu, 22 Oct 2015 07:00:58 -0700 (PDT) Sender: Paolo Bonzini References: <5628167C.9020802@redhat.com> <87eggn6rl9.fsf@blackfin.pond.sub.org> <5628EABF.8060009@redhat.com> From: Paolo Bonzini Message-ID: <5628EC17.9060503@redhat.com> Date: Thu, 22 Oct 2015 16:00:55 +0200 MIME-Version: 1.0 In-Reply-To: <5628EABF.8060009@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] DO_UPCAST confusion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Markus Armbruster , Peter Maydell Cc: "qemu-devel@nongnu.org" -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 22/10/2015 15:55, Eric Blake wrote: > Or maybe container_of_first(), to make it obvious that the parent > class is the first member. > > But how often does it really matter whether the container of the > parent class had the parent as the first member? I guess we'll > find out as we try to nuke DO_UPCAST. It's just a compile-time check. DO_UPCAST is basically a type-safe(r) version of (Foo *)bar. Paolo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWKOwUAAoJEL/70l94x66DS+gH/Rk7DXLNiYm0jhsgKwxfZHCn sygpayCGxpiSJ1PeRlNwjCImt1+wazqohStogCxnMkvB8mcAY5C8tTxsShzh1eao jEkGkwPcpDdR6bC5LSzot8uNI/GZEC1xEoXF8Zi6Y+t62LfL+hmKgydxrBNu4GHk kzczEv/4DpLh2KsZOj/yOmuw9b3hn0z05wM5taZvr/zVWB2eqenTISUF4PttgSi/ QrZapdHM0kq2Y9iGdM2necIFWwRjSm+8Gjs/cdETp30gSCA+TqlFnGgD4+sW2lrM C3gc5KzttgAuoNMkUNo7ibRV3P1qA/aiOZFzO4LXMrV69yox7ur8OrakXR8hOJA= =J4SY -----END PGP SIGNATURE-----