From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQjSG-00050Q-BF for qemu-devel@nongnu.org; Mon, 30 Sep 2013 15:48:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQjS7-0003n2-Um for qemu-devel@nongnu.org; Mon, 30 Sep 2013 15:48:28 -0400 Received: from mail-yh0-x229.google.com ([2607:f8b0:4002:c01::229]:34798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQjS7-0003my-QN for qemu-devel@nongnu.org; Mon, 30 Sep 2013 15:48:19 -0400 Received: by mail-yh0-f41.google.com with SMTP id f73so2167917yha.28 for ; Mon, 30 Sep 2013 12:48:19 -0700 (PDT) Sender: Richard Henderson Message-ID: <5249D57E.2040003@twiddle.net> Date: Mon, 30 Sep 2013 12:48:14 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1379945085-29086-1-git-send-email-rth@twiddle.net> <1379945085-29086-8-git-send-email-rth@twiddle.net> <5249BF37.50000@suse.de> In-Reply-To: <5249BF37.50000@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/10] target-s390: Fix STIDP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On 09/30/2013 11:13 AM, Alexander Graf wrote: >> - int cpu_num; >> + union { >> + uint64_t cpuid; >> + struct { >> +#ifdef HOST_WORDS_BIGENDIAN >> + uint32_t cpu_num; >> + uint32_t machine_type; >> +#else >> + uint32_t machine_type; >> + uint32_t cpu_num; >> +#endif > > Are we guaranteed that we don't need to pack? Also anonymous unions/structs are > a gcc extension IIRC. And why do you swap endianness here, but not above when > defining the machine_type value? (1) I can't imagine that we would; such struct/unions are used all over. (2) Sure, but we've so many other gcc extensions I figured it didn't matter. (3) Of course. I want host endianness, not target endianness. r~