Richard Henderson <[email protected]> writes:
> On 6/27/22 14:37, Alex Bennée wrote: >> Richard Henderson <[email protected]> writes: >> >>> Signed-off-by: Richard Henderson <[email protected]> >>> --- >>> semihosting/arm-compat-semi.c | 27 ++++++++++++++++++--------- >>> 1 file changed, 18 insertions(+), 9 deletions(-) >>> >>> diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c >>> index 20e99cdcc0..4c8932ad54 100644 >>> --- a/semihosting/arm-compat-semi.c >>> +++ b/semihosting/arm-compat-semi.c >>> @@ -302,6 +302,22 @@ common_semi_flen_fstat_cb(CPUState *cs, uint64_t ret, >>> int err) >>> common_semi_cb(cs, ret, err); >>> } >>> +static void >>> +common_semi_readc_cb(CPUState *cs, uint64_t ret, int err) >>> +{ >>> + if (!err) { >>> + CPUArchState *env G_GNUC_UNUSED = cs->env_ptr; >> Why do you even both extracting env here if it's not being used? >> >>> + uint8_t ch; >>> + >>> + if (get_user_u8(ch, common_semi_stack_bottom(cs) - 1)) { > > It is used in here, for system-mode, but not user-mode. > It's ugly, I know, but that's the interface we inherited. > The simplest non-ifdef solution is to mark the variable unused. Fair enough. > > > r~ -- Alex Bennée
