diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-05 08:11:09 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-05 13:41:07 +0200 |
commit | 1d39e96470b27195d35a69cc94551c403b7980bd (patch) | |
tree | 14c8ad389e18fb8ba9843f07326b8d12f11973ef /cpukit/include/rtems/score/basedefs.h | |
parent | tests: Use rtems_task_exit() (diff) | |
download | rtems-1d39e96470b27195d35a69cc94551c403b7980bd.tar.bz2 |
score: Fix legacy RTEMS_STATIC_ASSERT()
In standard C pointer operands are not allowed in integer constant
expressions. Avoid a static assertion based on an array typedef since
this could lead to warnings ("variably modified 'x' at file scope" and
"typedef 'x' locally defined but not used");
This implementation requires unique messages.
Diffstat (limited to 'cpukit/include/rtems/score/basedefs.h')
-rw-r--r-- | cpukit/include/rtems/score/basedefs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h index fd803e1b45..0a2bf8dd17 100644 --- a/cpukit/include/rtems/score/basedefs.h +++ b/cpukit/include/rtems/score/basedefs.h @@ -317,7 +317,8 @@ _Static_assert(cond, # msg) #else #define RTEMS_STATIC_ASSERT(cond, msg) \ - typedef int rtems_static_assert_ ## msg [(cond) ? 1 : -1] + struct rtems_static_assert_ ## msg \ + { int rtems_static_assert_ ## msg : (cond) ? 1 : -1; } #endif #define RTEMS_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) |