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 issue in m32c/gdb-if.c
Date: Sun, 21 Jan 2024 22:43:36 -0500 [thread overview]
Message-ID: <Za3kaGzeli3bc6bl@vapier> (raw)
In-Reply-To: <20240121225709.575321-1-mark@klomp.org>
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
On 21 Jan 2024 23:57, 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 memory in m32c/gdb-if.c
hmm, seems like we should change all sim_read/sim_write to use "addr"
instead of "mem" to be more consistent with other core APIs.
if you don't want to clean them all up, we should at least change the
include/sim/sim.h header and adjust m32c to match to fix the warnings.
-mike
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-01-22 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-21 22:57 Mark Wielaard
2024-01-22 3:43 ` Mike Frysinger [this message]
2024-01-22 11:27 ` 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=Za3kaGzeli3bc6bl@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