From 26ea29ddbab238db09b77368fa403e5508f3612c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 27 May 2025 11:44:18 -0700 Subject: [PATCH] toolchain: xcc: define __deprecated only if not already defined Some tests explicitly test for deprecated functions and they override the macro __deprecated to avoid compiler warnings. So, for xcc/xt-clang, only define __deprecated if it has not already been defined. Signed-off-by: Daniel Leung --- include/zephyr/toolchain/xcc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zephyr/toolchain/xcc.h b/include/zephyr/toolchain/xcc.h index 2a7b678e0ab..bc9c69e227e 100644 --- a/include/zephyr/toolchain/xcc.h +++ b/include/zephyr/toolchain/xcc.h @@ -15,7 +15,9 @@ * XCC does not support using deprecated attribute in enum, * so just nullify it here to avoid compilation errors. */ +#ifndef __deprecated #define __deprecated +#endif #define __in_section_unique(seg) \ __attribute__((section("." STRINGIFY(seg) "." STRINGIFY(__COUNTER__))))