Skip to content
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

Why not use the compatible type __attribute__((__noreturn__)) as __NO_RETURN for IAR? #198

Open
SuperHeroAbner opened this issue Nov 6, 2024 · 3 comments

Comments

@SuperHeroAbner
Copy link

SuperHeroAbner commented Nov 6, 2024

The type of attribute((noreturn)) can be put before or after function like 'void func(void) __NO_RETURN;'. If use the type of [[noreturn]] or _Noreturn, it must be like '__NO_RETURN void func(void)'
CMSIS_6 https://github.com/ARM-software/CMSIS_6/blob/main/CMSIS/Core/Include/cmsis_iccarm.h#L57
CMSIS_5 https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/Core/Include/cmsis_iccarm.h#L130
This introduces compatibility issue. Does attribute((noreturn)) have any issue to apply on IAR compared with _Noreturn + [[noreturn]] ?

@JonatanAntoni
Copy link
Member

The compiler header for IAR is provided and maintained by IAR. Please consider raising this question directly with them as I am not aware how frequently they are watching CMSIS issues.

@ReinhardKeil
Copy link
Contributor

@jlonnberg maybe you can help.

@RobinKastberg
Copy link
Contributor

@SuperHeroAbner
We reasoned that it was better to follow C standard and we had an issue from a customer that wanted to allow usage of __NO_RETURN in strict language mode.

We can try to have another go here but it is hard to please everyone.

What are the benefits of having __NO_RETURN afterwards and what compatibility did we break? I recall something in trustedfirmware-m?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants