diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 71aea3a12018e..4fa3584a07d32 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -63,6 +63,11 @@ New APIs and options like you need to add more details, add them in the API documentation code instead. +* Toolchain + + * :c:macro:`__deprecated_version` + + New Boards ********** diff --git a/include/zephyr/toolchain/gcc.h b/include/zephyr/toolchain/gcc.h index de2713f5ad425..e68a4e141c657 100644 --- a/include/zephyr/toolchain/gcc.h +++ b/include/zephyr/toolchain/gcc.h @@ -286,6 +286,11 @@ do { \ */ #endif +#ifndef __deprecated_version +#define __deprecated_version(version) \ + __attribute__((deprecated("planned removal in v" #version))) +#endif + #ifndef __attribute_const__ #define __attribute_const__ __attribute__((__const__)) #endif diff --git a/include/zephyr/toolchain/iar/iccarm.h b/include/zephyr/toolchain/iar/iccarm.h index e6a3cb96d3b29..e5fe19e821d85 100644 --- a/include/zephyr/toolchain/iar/iccarm.h +++ b/include/zephyr/toolchain/iar/iccarm.h @@ -187,6 +187,11 @@ do { \ #define __deprecated __attribute__((deprecated)) #endif +#ifndef __deprecated_version +#define __deprecated_version(version) \ + __attribute__((deprecated("planned removal in v" #version))) +#endif + #define FUNC_NO_STACK_PROTECTOR _Pragma("no_stack_protect") #ifndef __attribute_const__ diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8f964bc654b2e..257f846ccd0a6 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -394,6 +394,7 @@ sub hash_show_words { __pure| __noclone| __deprecated| + __deprecated_version| __read_mostly| __ro_after_init| __kprobes| diff --git a/scripts/tags.sh b/scripts/tags.sh index 2a3dd16494a8a..958457dd9848e 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -58,7 +58,7 @@ exuberant() -I __initdata,__exitdata,__initconst, \ -I __initdata_memblock \ -I __refdata,__attribute,__maybe_unused,__always_unused \ - -I __acquires,__releases,__deprecated \ + -I __acquires,__releases,__deprecated,__deprecated_version \ -I __read_mostly,__aligned,____cacheline_aligned \ -I ____cacheline_aligned_in_smp \ -I __cacheline_aligned,__cacheline_aligned_in_smp \