Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: fix gdbarch_tdep ODR violation
Date: Mon, 15 Nov 2021 16:47:11 +0000	[thread overview]
Message-ID: <02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net> (raw)
In-Reply-To: <20211112204233.4108340-1-simon.marchi@efficios.com>

On 2021-11-12 20:42, Simon Marchi via Gdb-patches wrote:
> +      aarch64_gdbarch_tdep *tdep
> +	= (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);

I'd think it would be nicer if we added a small wrapper function to each module, like:

static aarch64_gdbarch_tdep *
aarch64_gdbarch_tdep (struct gdbarch *gdbarch)
{
   return (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);
}

and then we we'd get rid of all the casts and duplicated type names at the callers, like:

     auto *tdep = aarch64_gdbarch_tdep (gdbarch);

That'd essentially require touching again most lines you already touched, so, yeah, for some
other rainy day...

  parent reply	other threads:[~2021-11-15 16:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 20:42 Simon Marchi via Gdb-patches
2021-11-12 21:55 ` John Baldwin
2021-11-15 10:45 ` Luis Machado via Gdb-patches
2021-11-15 16:29   ` Simon Marchi
2021-11-15 20:42     ` will schmidt via Gdb-patches
2021-11-15 20:43       ` Simon Marchi via Gdb-patches
2021-11-15 23:19         ` Luis Machado via Gdb-patches
2021-11-16  2:02           ` Simon Marchi via Gdb-patches
2021-11-15 16:47 ` Pedro Alves [this message]
2021-11-15 16:53   ` Simon Marchi

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=02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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