This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v3] Fix misaligned accesses to fields in HEADER struct defined in <arpa/nameser_compat.h>


On 2016-06-22, at 6:51 AM, Mike Frysinger wrote:

> On 17 Jun 2016 18:52, John David Anglin wrote:
>> --- a/resolv/res_mkquery.c
>> +++ b/resolv/res_mkquery.c
>> @@ -83,6 +83,8 @@
>> # define RANDOM_BITS(Var) { uint64_t v64; HP_TIMING_NOW (v64); Var = v64; }
>> #endif
>> 
>> +typedef HEADER __attribute__ ((aligned(1))) HEADER1;
> 
> could do with a comment above it explaining what this is all about
> 
> should be __aligned__
> 
> bike shed: maybe "UHEADER" is better ?
> 
> code-wise, should this file always be using this variant ?  would
> it be too ugly to do:
> 	typedef ...
> 	#define HEADER HEADER1

The attached patch implements the above suggestions except for res_query.c where
is directly substituted as necessary.

Tested on hppa-unknown-linux-gnu with a trunk build and check.

Please install if okay.

Dave
--
John David Anglin	dave.anglin@bell.net


Attachment: submitted-header-v3.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]