[PATCH v2] Fix misaligned access accessing HEADER struct in res_query.c

Mike Frysinger vapier@gentoo.org
Wed Jun 22 10:51:00 GMT 2016


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
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160622/aff0f9d7/attachment.sig>


More information about the Libc-alpha mailing list