[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH trivial] unicore32: convert get_sp_from_cpustate
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH trivial] unicore32: convert get_sp_from_cpustate from macro to inline |
Date: |
Tue, 29 Dec 2015 13:53:07 +0000 |
On 29 December 2015 at 09:43, Michael Tokarev <address@hidden> wrote:
> All other architectures define get_sp_from_cpustate as an inline function,
> only unicore32 uses a #define. With this, some usages are impossible, for
> example, enabling sigaltstack in linux-user/syscall.c results in
>
> linux-user/syscall.c: In function ‘do_syscall’:
> linux-user/syscall.c:8299:39: error: dereferencing ‘void *’ pointer [-Werror]
> get_sp_from_cpustate(arg1, arg2, get_sp_from_cpustate((CPUArchState
> *)cpu_env));
> ^
> linux-user/syscall.c:8299:39: error: request for member ‘regs’ in something
> not a structure or union
I think this is a bug in the macro implementation (lack of
brackets around the macro argument on its RHS) rather than
a macro being impossible to use for this, but I agree that
the inline function is better both for consistency with other
targets and as a style issue.
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM