Gentoo Archives: gentoo-dev

From: "Harald van Dijk" <truedfx@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] strict-aliasing rules, don't break them
Date: Sat, 17 Jun 2006 13:43:51
Message-Id: 20060617133639.GB1848@gentoo.org
In Reply to: Re: [gentoo-dev] strict-aliasing rules, don't break them by Ciaran McCreesh
1 On Sat, Jun 17, 2006 at 02:28:28PM +0100, Ciaran McCreesh wrote:
2 > On Sat, 17 Jun 2006 15:20:52 +0200 Harald van Dijk <truedfx@g.o>
3 > wrote:
4 > | and then accessing {first, null}, or {null, last} as a struct dl_node
5 > | the way to fix the code would be to rewrite the code to use arrays
6 > | of pointers instead of simply three pointer members. There is no
7 > | valid way to do what the code does using pointer members (that's
8 > | simple logic: it relies on the padding between first and null to be
9 > | exactly the same as that between null and last, which is a guarantee
10 > | standard C doesn't make), so fixing it requires quite a bit of work.
11 >
12 > It can be done using nested structs.
13
14 No, it can't: the two dl_nodes overlap.
15 --
16 gentoo-dev@g.o mailing list