Skip to content

toolchain: Add the __deprecated_version macro #91934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/releases/release-notes-4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
**********

Expand Down
5 changes: 5 additions & 0 deletions include/zephyr/toolchain/gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions include/zephyr/toolchain/iar/iccarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
1 change: 1 addition & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ sub hash_show_words {
__pure|
__noclone|
__deprecated|
__deprecated_version|
__read_mostly|
__ro_after_init|
__kprobes|
Expand Down
2 changes: 1 addition & 1 deletion scripts/tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Loading