From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23185 invoked by alias); 1 Oct 2013 12:53:16 -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 23167 invoked by uid 89); 1 Oct 2013 12:53:16 -0000 Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Oct 2013 12:53:16 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga03.intel.com Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 01 Oct 2013 05:53:08 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by azsmga001.ch.intel.com with ESMTP; 01 Oct 2013 05:53:06 -0700 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 1 Oct 2013 13:53:06 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.29]) by IRSMSX152.ger.corp.intel.com ([163.33.192.66]) with mapi id 14.03.0123.003; Tue, 1 Oct 2013 13:53:06 +0100 From: "Agovic, Sanimir" To: 'Mark Kettenis' , "ooprala@redhat.com" CC: "gdb-patches@sourceware.org" Subject: RE: C++-compat clean build Date: Tue, 01 Oct 2013 12:53:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176850E2@IRSMSX105.ger.corp.intel.com> References: <524AB12E.8090209@redhat.com> <201310011204.r91C4QVo006124@glazunov.sibelius.xs4all.nl> In-Reply-To: <201310011204.r91C4QVo006124@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00041.txt.bz2 Thanks Ondrej for taking the initiative! > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf > Of Mark Kettenis > Sent: Tuesday, October 01, 2013 02:04 PM > To: ooprala@redhat.com > Cc: gdb-patches@sourceware.org > Subject: Re: C++-compat clean build > > Rejected. Introducing all these casts can't be right. They hide type > conversion issues and make the code unreadable. > Afaik, some casts are required to some extend as C++ does no implicit from/= to void * conversion. But in general I agree about using casts too vast. @@ -1598,7 +1598,7 @@ amd64_relocate_instruction (struct gdbarch *gdbarch, int len =3D gdbarch_max_insn_length (gdbarch); /* Extra space for sentinels. */ int fixup_sentinel_space =3D len; - gdb_byte *buf =3D xmalloc (len + fixup_sentinel_space); + gdb_byte *buf =3D (gdb_byte *) xmalloc (len + fixup_sentinel_space); This looks OK to me and could be replaced with a type save new[] once C++ i= s used. @@ -1178,7 +1178,7 @@ amd64_linux_syscall_record (struct regcache *regcache) { int ret; ULONGEST syscall_native; - enum gdb_syscall syscall_gdb =3D -1; + enum gdb_syscall syscall_gdb =3D (enum gdb_syscall) -1; ... whereas this looks wrong to me in both cases before/after. Here we shou= ld add something like SYSCALL_INVALID/UNKNOWN to enum gdb_syscall.=20 Thanks again for your efforts Ondrej. -Sanimir > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf > Of Mark Kettenis > Sent: Tuesday, October 01, 2013 02:04 PM > To: ooprala@redhat.com > Cc: gdb-patches@sourceware.org > Subject: Re: C++-compat clean build >=20 > > Date: Tue, 01 Oct 2013 13:25:34 +0200 > > From: Ondrej Oprala > > > > Hi, > > this is the first of a few patches I intend to write to make gdb code > > compile cleanly with -Wc++-compat. > > The idea is to make separate patches for respective subdirs under gdb/, > > unless someone objects ofc. > > > > Thanks in advance for any advice/criticism. >=20 > Rejected. Introducing all these casts can't be right. They hide type > conversion issues and make the code unreadable. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052