[PATCH xserver 1/1] list: Use offsetof() to determine member offsets within a structure
Jeremy Huddleston Sequoia
jeremyhu at apple.com
Wed Aug 29 14:09:32 PDT 2012
On Aug 29, 2012, at 2:00 PM, Jeremy Huddleston Sequoia <jeremyhu at apple.com> wrote:
>
> On Aug 29, 2012, at 12:28 PM, Mark Kettenis <mark.kettenis at xs4all.nl> wrote:
>
>> Jeremy, did clang actually complain about __container_of() as well, or
>> was the change to that function just an optimization?
>
> It doesn't complain (no warning, no error). If run with -O1 or higher, it just produces code which results in a segfault when the server launches. __container_of is the cause of the segfault because __container_of is used by xorg_list_for_each_entry.
Actually, I take that back. It does print a -Wuninitialized warning, but it's not really clear the implications of that because I think anyone reasonable would look at that and say "well I don't care that it's uninitialized because we don't need the actual value, just the delta" …
--Jeremy
More information about the xorg-devel
mailing list