From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8181 invoked by alias); 9 Sep 2010 16:32:43 -0000 Received: (qmail 8160 invoked by uid 22791); 9 Sep 2010 16:32:40 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_DL X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Sep 2010 16:32:34 +0000 Received: from md2.u-strasbg.fr (md2.u-strasbg.fr [IPv6:2001:660:2402::187]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o89GWP65038909 ; Thu, 9 Sep 2010 18:32:25 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms5.u-strasbg.fr [IPv6:2001:660:2402:d::14]) by md2.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o89GWORY035386 ; Thu, 9 Sep 2010 18:32:24 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o89GWOcU092066 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 9 Sep 2010 18:32:24 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Andreas Schwab'" Cc: , References: <2531.82755918733$1284046069@news.gmane.org> In-Reply-To: Subject: RE: [RFA] Fix gdb compilation error in opcodes/dlx-dis.c with --enable-targets=all for mingw64 Date: Thu, 09 Sep 2010 19:56:00 -0000 Message-ID: <004001cb503c$9879a580$c96cf080$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2010-09/txt/msg00205.txt.bz2 > What's wrong with dlx_insn? >=20 > Andreas. Whoops, nothing in fact... It's just that as it was typecast to an integer, I tried to find an integer type that was of the same size as a pointer for all configurations. I found out that bfd_hostptr_t was this type, so I went on using that type. Of course you are right, it is much cleaner to directly typecast it to the correct type. Here is a new version of the patch. Is this OK? 2010-09-09 Pierre Muller * src/opcodes/dlx-dis.c (print_insn_dlx): Use dlx_insn type for dlx_insn_type array. Index: src/opcodes/dlx-dis.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/opcodes/dlx-dis.c,v retrieving revision 1.5 diff -u -p -r1.5 dlx-dis.c --- src/opcodes/dlx-dis.c 27 Jun 2010 04:07:55 -0000 1.5 +++ src/opcodes/dlx-dis.c 9 Sep 2010 12:06:19 -0000 @@ -437,18 +437,18 @@ print_insn_dlx (bfd_vma memaddr, struct=20 bfd_byte buffer[4]; int insn_idx; unsigned long insn_word; - unsigned long dlx_insn_type[] =3D + dlx_insn dlx_insn_type[] =3D { - (unsigned long) dlx_r_type, - (unsigned long) dlx_load_type, - (unsigned long) dlx_store_type, - (unsigned long) dlx_aluI_type, - (unsigned long) dlx_br_type, - (unsigned long) dlx_jmp_type, - (unsigned long) dlx_jr_type, - (unsigned long) NULL + dlx_r_type, + dlx_load_type, + dlx_store_type, + dlx_aluI_type, + dlx_br_type, + dlx_jmp_type, + dlx_jr_type, + (dlx_insn) NULL }; - int dlx_insn_type_num =3D ((sizeof dlx_insn_type) / (sizeof (unsigned lo= ng))) - 1; + int dlx_insn_type_num =3D ((sizeof dlx_insn_type) / (sizeof (dlx_insn)))= - 1; int status =3D (*info->read_memory_func) (memaddr, (bfd_byte *) &buffer[0], 4, info); =20 @@ -483,7 +483,7 @@ print_insn_dlx (bfd_vma memaddr, struct=20 current_insn_addr =3D (unsigned long) memaddr; =20 for (insn_idx =3D 0; dlx_insn_type[insn_idx] !=3D 0x0; insn_idx++) - switch (((dlx_insn) (dlx_insn_type[insn_idx])) (info)) + switch (((dlx_insn_type[insn_idx])) (info)) { /* Found the correct opcode */ case R_TYPE: