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/rtems/confdefs/inittask.h | |
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 '')
-rw-r--r-- | cpukit/include/rtems/confdefs/inittask.h | 21 |
1 files changed, 21 insertions, 0 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, |