From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9846 invoked by alias); 8 Nov 2016 21:43:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 9834 invoked by uid 89); 8 Nov 2016 21:43:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Nov 2016 21:43:23 +0000 Received: by simark.ca (Postfix, from userid 33) id D92C71E75C; Tue, 8 Nov 2016 16:43:21 -0500 (EST) To: "Maciej W. Rozycki" Subject: Re: [PATCH] gdbarch: Use an anonymous union for target data in `gdbarch_info' X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Nov 2016 21:43:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org, Simon Marchi In-Reply-To: References: Message-ID: <68783b4bebb59fa288d261a8f217cf82@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.2 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00190.txt.bz2 On 2016-10-18 12:19, Maciej W. Rozycki wrote: > As an update to commit ede5f15146ae ("gdbarch.h: Change > gdbarch_info::tdep_info's type to void *") replace the definition of > the > `tdep_info' member in `struct gdbarch_info' with an anonymous union, > comprising the original member, with its type reverted to `struct > gdbarch_tdep_info *', a `tdesc_data' member of a `struct > tdesc_arch_data > *' type and an `id' member of an `int *' type. Remove now unnecessary > casts throughout use places then, making code easier to read an less > prone to errors, which may happen with casting. I glanced quickly at your patch, and I think it looks good. As Yao said, some comments would be nice, because just like that it's hard to understand why those fields are grouped together in an union, as they seem unrelated to each other.