From patchwork Mon Oct 12 04:32:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 9051 Received: (qmail 75662 invoked by alias); 12 Oct 2015 04:32:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 75549 invoked by uid 89); 12 Oct 2015 04:32:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Oct 2015 04:32:18 +0000 Received: from simark.lan. (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id 72BB7440E7A; Mon, 12 Oct 2015 00:32:17 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH c++ 3/6] xtensa: Fix implicit enum conversions Date: Mon, 12 Oct 2015 00:32:06 -0400 Message-Id: <1444624329-4828-3-git-send-email-simon.marchi@polymtl.ca> In-Reply-To: <1444624329-4828-1-git-send-email-simon.marchi@polymtl.ca> References: <1444624329-4828-1-git-send-email-simon.marchi@polymtl.ca> MIME-Version: 1.0 XTREG is used with raw numbers, like: ... XTREG( 78,312,32, 4, 4,0x02d7,0x0007,-2, 2,0x1000,excsave7, 0,0,0,0,0,0) XTREG( 79,316, 8, 4, 4,0x02e0,0x0007,-2, 2,0x1000,cpenable, 0,0,0,0,0,0) XTREG( 80,320,22, 4, 4,0x02e2,0x000b,-2, 2,0x1000,interrupt, 0,0,0,0,0,0) XTREG( 81,324,22, 4, 4,0x02e2,0x000d,-2, 2,0x1000,intset, 0,0,0,0,0,0) ... So just add the explicit cast to the macro. In file included from /home/pedro/gdb/mygit/src/gdb/xtensa-config.c:25:0: /home/pedro/gdb/mygit/src/gdb/xtensa-tdep.h:289:2: error: invalid conversion from ‘int’ to ‘call_abi_t’ [-fpermissive] } ^ gdb/ChangeLog: * xtensa-tdep.h (XTREG): Add casts. (XTREG_END): Likewise. --- gdb/xtensa-tdep.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index fbf0e1d..275f40d 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -124,9 +124,13 @@ typedef struct /* For xtensa-config.c to expand to the structure above. */ #define XTREG(index,ofs,bsz,sz,al,tnum,flg,cp,ty,gr,name,fet,sto,mas,ct,x,y) \ - {#name, ofs, ty, ((gr) | ((xtRegisterGroupNCP >> 2) << (cp + 2))), \ + {#name, ofs, (xtensa_register_type_t) (ty), \ + ((xtensa_register_group_t) \ + ((gr) | ((xtRegisterGroupNCP >> 2) << (cp + 2)))), \ ct, bsz, sz, al, tnum, flg, cp, mas, fet, sto}, -#define XTREG_END {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0}, +#define XTREG_END \ + {0, 0, (xtensa_register_type_t) 0, (xtensa_register_group_t) 0, \ + 0, 0, 0, 0, -1, 0, 0, 0, 0, 0}, #define XTENSA_REGISTER_FLAGS_PRIVILEGED 0x0001 #define XTENSA_REGISTER_FLAGS_READABLE 0x0002