From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZFOwC-0003z5-E0 for mharc-grub-devel@gnu.org; Wed, 15 Jul 2015 11:49:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFOwA-0003yv-0Z for grub-devel@gnu.org; Wed, 15 Jul 2015 11:49:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFOw9-0002NC-1J for grub-devel@gnu.org; Wed, 15 Jul 2015 11:49:33 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:35110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFOw8-0002N2-R3 for grub-devel@gnu.org; Wed, 15 Jul 2015 11:49:32 -0400 Received: by wiga1 with SMTP id a1so3796293wig.0 for ; Wed, 15 Jul 2015 08:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=va7EBr1xsFYBb0jiBbx3L40pziD8YdOaHEzZUKFTvk8=; b=gUcO+0MFomIvOlm5fPmowi6qDmQtiTz4niH1aDfh7Rjz05KyyE+W0lThuuvWLeK3GV 35Vv+W/HAoFP+L9PxTPLZ2rkUIi5gIAtUqNka9hfJI3mRNXRSbE41qcgisM45sKynHlB AUS5DnHpzkIE95QcvmVRZQBKEfXpb0v18MPkIvcwMjULAh9HrDfOd1hc/j9wthNDsQdq nAwpiFycAgizHxt1Hylc0sB3h7zlVmxK1et392kgVuIAoGOEQOvWDN+JGj0TuZrIbTu7 TvFhlG73EG2AW6npD+2YZ6UfJq1m1jlM1L2lrY31C4PHyQ0X/FmsWqbToTFt5Pn0c1+f dlIA== X-Received: by 10.180.75.15 with SMTP id y15mr1331408wiv.51.1436975372151; Wed, 15 Jul 2015 08:49:32 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:863a:4bff:fe50:abc4? ([2620:0:105f:fd00:863a:4bff:fe50:abc4]) by smtp.gmail.com with ESMTPSA id bq7sm8504068wjc.31.2015.07.15.08.49.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 08:49:31 -0700 (PDT) Message-ID: <55A6810A.60408@gmail.com> Date: Wed, 15 Jul 2015 17:49:30 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] zfs: fix compilation failure with clang due to alignment References: <1435950347-20073-1-git-send-email-arvidjaar@gmail.com> In-Reply-To: <1435950347-20073-1-git-send-email-arvidjaar@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tx2n598HipiFMcqKBFFOO0RMkcHidu1PJ" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 15:49:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tx2n598HipiFMcqKBFFOO0RMkcHidu1PJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03.07.2015 21:05, Andrei Borzenkov wrote: > I do not claim I understand why clang complains, but this patch does > fix it. >=20 > fs/xfs.c:452:25: error: cast from 'struct grub_xfs_btree_node *' to > 'grub_uint64_t *' (aka 'unsigned long long *') increases required= > alignment from 1 to 8 [-Werror,-Wcast-align] > grub_uint64_t *keys =3D (grub_uint64_t *)(leaf + 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. >=20 > --- >=20 > Jan, do you have any idea what's wrong and whether this is proper fix? > Or should I raise it with clang? >=20 > grub-core/fs/xfs.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c > index 7249291..ea8cf7e 100644 > --- a/grub-core/fs/xfs.c > +++ b/grub-core/fs/xfs.c > @@ -445,14 +445,14 @@ grub_xfs_next_de(struct grub_xfs_data *data, stru= ct grub_xfs_dir2_entry *de) > return (struct grub_xfs_dir2_entry *)(((char *)de) + ALIGN_UP(size, = 8)); > } > =20 > -static grub_uint64_t * > +static void * > grub_xfs_btree_keys(struct grub_xfs_data *data, > struct grub_xfs_btree_node *leaf) > { > - grub_uint64_t *keys =3D (grub_uint64_t *)(leaf + 1); > + char *keys =3D (char *)leaf + sizeof (*leaf); > =20 > if (data->hascrc) > - keys +=3D 6; /* skip crc, uuid, ... */ > + keys +=3D 6 * sizeof (grub_uint64_t); /* skip crc, uuid, ... */ > return keys; > } > =20 This would only hide the problem behind void*. Leif's patch solves the problem. Another possibility is to analyze if packed is really required but most likely it is. >=20 --tx2n598HipiFMcqKBFFOO0RMkcHidu1PJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlWmgQsACgkQmBXlbbo5nOueewD+PA60GhS4DTV8SI/KVNnYfRkk 5n4W6gOeS9Hr7a2v+t8A/2yi8hkydHpZfeHqHu7LMnxcF8lj/HoT5cQA/EvHu5B3 =rTGt -----END PGP SIGNATURE----- --tx2n598HipiFMcqKBFFOO0RMkcHidu1PJ--