forked from Imagelibrary/binutils-gdb
sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read,write}
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.
This commit is contained in:
@@ -27,17 +27,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
modeling real hardware */
|
||||
|
||||
uint64_t
|
||||
sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length)
|
||||
sim_read (SIM_DESC sd, uint64_t addr, void *buffer, uint64_t length)
|
||||
{
|
||||
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
||||
return sim_core_read_buffer (sd, NULL, read_map,
|
||||
buffer, mem, length);
|
||||
buffer, addr, length);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length)
|
||||
sim_write (SIM_DESC sd, uint64_t addr, const void *buffer, uint64_t length)
|
||||
{
|
||||
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
||||
return sim_core_write_buffer (sd, NULL, write_map,
|
||||
buffer, mem, length);
|
||||
buffer, addr, length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user