Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Mark Wielaard <mark@klomp.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read,write}
Date: Mon, 22 Jan 2024 08:14:04 -0500	[thread overview]
Message-ID: <Za5qHPykA-da8lKN@vapier> (raw)
In-Reply-To: <20240122120534.232865-1-mark@klomp.org>

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On 22 Jan 2024 13:05, Mark Wielaard wrote:
> m32c/cpu.h defines mem as enum value, which causes GCC 14 to emit
> 
> sim/m32c/gdb-if.c: In function ‘sim_read’:
> sim/m32c/gdb-if.c:162:33: error: declaration of ‘mem’ shadows a previous local [-Werror=shadow=local]
>   162 | sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
>       |                        ~~~~~~~~~^~~
> In file included from ../../binutils-gdb/sim/m32c/gdb-if.c:38:
> sim/m32c/cpu.h:83:3: note: shadowed declaration is here
>    83 |   mem,
>       |   ^~~
> 
> Fix this by renaming mem to addr in all sim_read and sim_write functions.
> Most already used addr instead of mem. In one file, sim/rx/gdb-if.c, this
> also meant renaming the local addr variable to vma.

lgtm, although missing include/sim/sim.h update
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-22 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 12:05 [PATCH] sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read, write} Mark Wielaard
2024-01-22 13:14 ` Mike Frysinger [this message]
2024-01-22 13:27   ` [PATCH] sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read,write} Mark Wielaard

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=Za5qHPykA-da8lKN@vapier \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark@klomp.org \
    /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