[PATCH 1/2] score: Add RTEMS_UNREACHABLE
Joel Sherrill
joel at rtems.org
Tue Mar 22 14:55:33 UTC 2016
On Tue, Mar 22, 2016 at 9:49 AM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:
> In case we reach the program point marked with RTEMS_UNREACHABLE(), then
> the behaviour is undefined according to the GCC documentation. Maybe we
> should add some stuff if RTEMS_DEBUG is defined.
>
> That seems reasonable. It is unlikely that we get there but if we do, you
really want to know.
The newlib patch for pthread_exit() should have hit their list.
> On 22/03/16 07:25, Sebastian Huber wrote:
>
>> ---
>> cpukit/score/include/rtems/score/basedefs.h | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/cpukit/score/include/rtems/score/basedefs.h
>> b/cpukit/score/include/rtems/score/basedefs.h
>> index facaed9..5d7f5b4 100644
>> --- a/cpukit/score/include/rtems/score/basedefs.h
>> +++ b/cpukit/score/include/rtems/score/basedefs.h
>> @@ -191,6 +191,15 @@
>> /* Provided for backward compatibility */
>> #define RTEMS_COMPILER_PACKED_ATTRIBUTE RTEMS_PACKED
>> +/**
>> + * @brief Tells the compiler that this program point is unreachable.
>> + */
>> +#if defined(__GNUC__)
>> + #define RTEMS_UNREACHABLE() __builtin_unreachable()
>> +#else
>> + #define RTEMS_UNREACHABLE()
>> +#endif
>> +
>> #if __cplusplus >= 201103L
>> #define RTEMS_STATIC_ASSERT(cond, msg) \
>> static_assert(cond, # msg)
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail : sebastian.huber at embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160322/d6a87926/attachment-0002.html>
More information about the devel
mailing list