diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-19 15:30:17 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-26 11:10:21 +0100 |
commit | bc175a1cabdccfc28deee3ae67ff5e9a0b5aef49 (patch) | |
tree | d581896d8efcab8b471502a9b79c541363509002 /cpukit/include | |
parent | config: Clarify the use of pragmas (diff) | |
download | rtems-bc175a1cabdccfc28deee3ae67ff5e9a0b5aef49.tar.bz2 |
Avoid INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
Replace a runtime check with a compile time assertion. This makes the
INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL obsolete.
Update #4181.
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/confdefs/inittask.h | 21 | ||||
-rw-r--r-- | cpukit/include/rtems/score/interr.h | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/cpukit/include/rtems/confdefs/inittask.h b/cpukit/include/rtems/confdefs/inittask.h index a91b9a5917..08eddc0334 100644 --- a/cpukit/include/rtems/confdefs/inittask.h +++ b/cpukit/include/rtems/confdefs/inittask.h @@ -100,6 +100,27 @@ extern "C" { #define CONFIGURE_INIT_TASK_ARGUMENTS 0 #endif +/* + * Ignore the following warnings from g++ and clang in the static assertion + * below: + * + * warning: the address of 'void Init()' will never be NULL [-Waddress] + * + * warning: comparison of function 'Init' not equal to a null pointer is always + * true [-Wtautological-pointer-compare] + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress" +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wtautological-pointer-compare" + +RTEMS_STATIC_ASSERT( + CONFIGURE_INIT_TASK_ENTRY_POINT != NULL, + CONFIGURE_INIT_TASK_ENTRY_POINT_MUST_NOT_BE_NULL +); + +#pragma GCC diagnostic pop + const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = { CONFIGURE_INIT_TASK_NAME, CONFIGURE_INIT_TASK_STACK_SIZE, diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h index 4b06199ae9..b1f1061c82 100644 --- a/cpukit/include/rtems/score/interr.h +++ b/cpukit/include/rtems/score/interr.h @@ -189,7 +189,7 @@ typedef enum { INTERNAL_ERROR_NO_MEMORY_FOR_HEAP = 23, INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR = 24, INTERNAL_ERROR_RESOURCE_IN_USE = 25, - INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL = 26, + /* INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL = 26, */ /* INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL = 27, */ INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK = 28, INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE = 29, |