From: "Agovic, Sanimir" <sanimir.agovic@intel.com>
To: 'Mark Kettenis' <mark.kettenis@xs4all.nl>,
"ooprala@redhat.com" <ooprala@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: C++-compat clean build
Date: Tue, 01 Oct 2013 12:53:00 -0000 [thread overview]
Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176850E2@IRSMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <201310011204.r91C4QVo006124@glazunov.sibelius.xs4all.nl>
Thanks Ondrej for taking the initiative!
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.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 = gdbarch_max_insn_length (gdbarch);
/* Extra space for sentinels. */
int fixup_sentinel_space = len;
- gdb_byte *buf = xmalloc (len + fixup_sentinel_space);
+ gdb_byte *buf = (gdb_byte *) xmalloc (len + fixup_sentinel_space);
This looks OK to me and could be replaced with a type save new[] once C++ is used.
@@ -1178,7 +1178,7 @@ amd64_linux_syscall_record (struct regcache *regcache)
{
int ret;
ULONGEST syscall_native;
- enum gdb_syscall syscall_gdb = -1;
+ enum gdb_syscall syscall_gdb = (enum gdb_syscall) -1;
... whereas this looks wrong to me in both cases before/after. Here we should
add something like SYSCALL_INVALID/UNKNOWN to enum gdb_syscall.
Thanks again for your efforts Ondrej.
-Sanimir
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.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
>
> > Date: Tue, 01 Oct 2013 13:25:34 +0200
> > From: Ondrej Oprala <ooprala@redhat.com>
> >
> > 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.
>
> 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
next prev parent reply other threads:[~2013-10-01 12:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 11:25 Ondrej Oprala
2013-10-01 11:52 ` Ondrej Oprala
2013-10-01 12:04 ` Mark Kettenis
2013-10-01 12:53 ` Agovic, Sanimir [this message]
2013-10-01 14:16 ` Pedro Alves
2013-10-01 16:34 ` Joel Brobecker
2013-10-01 12:53 ` Jan Kratochvil
2013-10-01 12:57 ` Ondrej Oprala
2013-10-01 13:06 ` Tedeschi, Walfred
2013-10-01 13:57 ` Pedro Alves
2013-10-03 20:39 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0377C58828D86C4588AEEC42FC3B85A7176850E2@IRSMSX105.ger.corp.intel.com \
--to=sanimir.agovic@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=ooprala@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox