[PATCH] rtems: Improve RTEMS_NO_RETURN attribute

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Oct 6 15:40:56 UTC 2020


On 06/10/2020 17:34, Joel Sherrill wrote:

>
> On Tue, Oct 6, 2020 at 9:46 AM Sebastian Huber 
> <sebastian.huber at embedded-brains.de 
> <mailto:sebastian.huber at embedded-brains.de>> wrote:
>
>     On 06/10/2020 16:37, Joel Sherrill wrote:
>
>     > How does it break the API? It looks like a change of annotation.
>     > Shouldn't be a big deal unless I am misunderstanding something.
>
>     Please have a look at:
>
>     https://lists.rtems.org/pipermail/devel/2020-October/062577.html
>
>
> Looks like basically the same code. What does this break? Why the concern?

The C11/C++11 attribute syntax is less flexible compared to the GNU 
attributes. For example:

echo "_Noreturn void ok(void);" > test.c

echo "void error(void) _Noreturn;" >> test.c

gcc test.c

test.c: In function ‘error’:
test.c:2:1: error: ‘_Noreturn’ in empty declaration
  void error(void) _Noreturn;
  ^~~~
test.c:2:18: warning: empty declaration
  void error(void) _Noreturn;
                   ^~~~~~~~~
test.c:2:1: error: expected ‘{’ at end of input
  void error(void) _Noreturn;
  ^~~~



More information about the devel mailing list