Commit 179c46be authored by Daniel Leung's avatar Daniel Leung Committed by Fabio Baltieri
Browse files

syscall: Z_SYSCALL_VERIFY_MSG to ignore -Wshadow



Z_SYSCALL_VERIFY_MSG() does LOG_MODULE_DECLARE() internally to
log errors during verification. However, this is definitely
going to conflict with any LOG_MODULE_DECLARE() in the source
file using Z_SYSCALL_VERIFY_MSG(). So we need to selectively
disable -Wshadow for Z_SYSCALL_VERIFY_MSG() to avoid compiler
warnings as this is an intentional behavior.

Signed-off-by: default avatarDaniel Leung <daniel.leung@intel.com>
parent 8dc9d89d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -311,7 +311,9 @@ extern int z_user_string_copy(char *dst, const char *src, size_t maxlen);
#define Z_SYSCALL_VERIFY_MSG(expr, fmt, ...) ({ \
	bool expr_copy = !(expr); \
	if (expr_copy) { \
		TOOLCHAIN_IGNORE_WSHADOW_BEGIN \
		LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); \
		TOOLCHAIN_IGNORE_WSHADOW_END \
		LOG_ERR("syscall %s failed check: " fmt, \
			__func__, ##__VA_ARGS__); \
	} \