diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2018-07-05 13:07:52 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2018-07-06 08:43:49 +0200 |
commit | f6d17e33e7b95c90a2521cfd37cd5cb511909fc4 (patch) | |
tree | 0af980e9e2d3ffe319f6e8754f39a3e72a70d103 /mk/config.mk | |
parent | 8a076f79bb033d6dabc302a772379406fc5b8aa6 (diff) |
core: define syscall_t as void (*)(void)
syscall_t is currently typedef'ed as TEE_Result (*)(void). It is used to
represent a pointer to any system call, in the syscall table for instance.
As such, the exact type behind syscall_t cannot reflect all the syscalls
since they have different prototypes. The current declaration with a
TEE_Result return type was probably chosen because it was a common
characteristic of all syscalls to return a TEE_Result.
However, this type causes compilation warnings with GCC 8.1:
core/arch/arm/tee/arch_svc.c:43:36: warning: cast between incompatible function types from ‘void (*)(long unsigned int)’ to ‘TEE_Result (*)(void)’ {aka ‘unsigned int (*)(void)’} [-Wcast-function-type]
#define SYSCALL_ENTRY(_fn) { .fn = (syscall_t)_fn }
^
core/arch/arm/tee/arch_svc.c:50:2: note: in expansion of macro ‘SYSCALL_ENTRY’
SYSCALL_ENTRY(syscall_sys_return),
^~~~~~~~~~~~~
The solution is to use 'void (*)(void)' instead, as explained in the GCC
documentation:
-Wcast-function-type
Warn when a function pointer is cast to an incompatible function
pointer. [...] The function type void (*) (void) is special and matches
everything, which can be used to suppress this warning. [...]
Link: [1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'mk/config.mk')
0 files changed, 0 insertions, 0 deletions