From 7bc28cf3885484442e033eb225f4e90a83e224e8 Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Fri, 10 Nov 2017 15:42:07 -0800 Subject: [PATCH] syscalls: REVERTME: clean up warnings when building unit tests This is a temporary hack until #5006 is resolved (possibly using https://github.com/zephyrproject-rtos/zephyr/issues/5006 Unit testing (BOARD == unit_testing) doesn't need the system call definitions. Because we foward declare with __syscall them as "static inline" (from common.h), the compilers will complain that the definition is missing. Change to only define __syscall as "static inline" if we are not builing a unit test to avoid said warnings. Signed-off-by: Inaky Perez-Gonzalez --- include/toolchain/common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/toolchain/common.h b/include/toolchain/common.h index 251ff701233..9d18a5ba658 100644 --- a/include/toolchain/common.h +++ b/include/toolchain/common.h @@ -108,8 +108,18 @@ /* Additionally used as a sentinel by gen_syscalls.py to identify what * functions are system calls + * + * Note POSIX unit tests don't still generate the system call stubs, so + * until https://github.com/zephyrproject-rtos/zephyr/issues/5006 is + * fixed via possibly #4174, we introduce this hack -- which will + * disallow us to test system calls in POSIX unit testing (currently + * not used). */ +#ifndef ZTEST_UNITTEST #define __syscall static inline +#else +#define __syscall +#endif /* #ifndef ZTEST_UNITTEST */ #ifndef BUILD_ASSERT /* compile-time assertion that makes the build fail */