This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix misaligned access accessing HEADER struct in res_query.c
- From: John David Anglin <dave dot anglin at bell dot net>
- To: Florian Weimer <fweimer at redhat dot com>, Andreas Schwab <schwab at suse dot de>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>
- Date: Wed, 15 Jun 2016 10:58:56 -0400
- Subject: Re: [PATCH] Fix misaligned access accessing HEADER struct in res_query.c
- Authentication-results: sourceware.org; auth=none
- References: <5E7CF115-219A-4260-BE53-19B5A8D1D7F3 at bell dot net> <d18a20fa-d486-7db4-e0bc-d6961a4499c2 at redhat dot com> <mvm60tazlxv dot fsf at hawking dot suse dot de> <5a20f0ea-0133-a380-0629-d377dc1c290c at bell dot net> <a7125f05-0127-61ff-f2f7-3545ccaf3e20 at redhat dot com>
On 2016-06-15 10:43 AM, Florian Weimer wrote:
I don't think the packed derivative affects the layout of HEADER given
the way the fields are
arranged.
I verified that it changes alignment, even on x86_64. That's the
intent, and it results in a layout change (if this struct is used as a
part of other structs, for example).
I'm suggesting this be done in res_query.c where we we need byte
alignment. Nothing else would
have access to this typedef, so it couldn't affect the layout of any
other structs.
Dave
--
John David Anglin dave.anglin@bell.net