From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127660 invoked by alias); 28 Sep 2015 15:45:32 -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 127624 invoked by uid 89); 28 Sep 2015 15:45:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 28 Sep 2015 15:45:28 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Sep 2015 16:45:22 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Sep 2015 16:45:19 +0100 X-MailFrom: uweigand@de.ibm.com X-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5AAB81B0806E for ; Mon, 28 Sep 2015 16:47:05 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t8SFjIe337748958 for ; Mon, 28 Sep 2015 15:45:19 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t8SEjJ8e024355 for ; Mon, 28 Sep 2015 08:45:19 -0600 Received: from oc7340732750.ibm.com (dyn-9-152-213-225.boeblingen.de.ibm.com [9.152.213.225]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t8SEjJlj024347; Mon, 28 Sep 2015 08:45:19 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 474FC2210; Mon, 28 Sep 2015 17:45:18 +0200 (CEST) Subject: Re: [PATCH 3/2] Add some more casts (2/2) To: simon.marchi@ericsson.com (Simon Marchi) Date: Mon, 28 Sep 2015 15:45:00 -0000 From: "Ulrich Weigand" Cc: qiyaoltc@gmail.com (Yao Qi), gdb-patches@sourceware.org In-Reply-To: <56059010.4020702@ericsson.com> from "Simon Marchi" at Sep 25, 2015 02:18:56 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20150928154518.474FC2210@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15092815-0021-0000-0000-0000056E1A2D X-SW-Source: 2015-09/txt/msg00604.txt.bz2 Simon Marchi wrote: > @@ -1350,7 +1352,7 @@ ppu2spu_sniffer (const struct frame_unwind *self, > info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu); > info.byte_order = BFD_ENDIAN_BIG; > info.osabi = GDB_OSABI_LINUX; > - info.tdep_info = (void *) &data.id; > + info.tdep_info = (struct gdbarch_tdep_info *) &data.id; > data.gdbarch = gdbarch_find_by_info (info); > if (!data.gdbarch) > return 0; This causes compilation to fail (with the RHEL5 system compiler): gdb/ppc-linux-tdep.c: In function 'ppu2spu_sniffer': gdb/ppc-linux-tdep.c:1355: warning: type-punning to incomplete type might break strict-aliasing rules The problem seems to be that "struct gdbarch_tdep_info" actually does not exist and is not defined anywhere. The info.tdep_info field is used as a generic pointer; different architectures use it for diffferent purposes. Maybe in this case the correct fix would be to leave the (void *) casts in place and actually change the type of the field to void * ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com