提交 c2f36c6c 编写于 作者: S Stefan Weil 提交者: Blue Swirl

exec-all: Fix void pointer arithmetic

Adding an offset to a void pointer works with gcc but is not allowed
by the current C standards. With -pedantic, gcc complains:

exec-all.h:344: error: pointer of type ‘void *’ used in arithmetic

Fix this, and also replace (unsigned long) by (uintptr_t) in the same
statement.
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 d787fcf4
......@@ -340,8 +340,7 @@ static inline tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong add
cpu_abort(env1, "Trying to execute code outside RAM or ROM at 0x" TARGET_FMT_lx "\n", addr);
#endif
}
p = (void *)(unsigned long)addr
+ env1->tlb_table[mmu_idx][page_index].addend;
p = (void *)((uintptr_t)addr + env1->tlb_table[mmu_idx][page_index].addend);
return qemu_ram_addr_from_host_nofail(p);
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册