diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-08 07:51:38 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-03 06:58:53 +0200 |
commit | 5b97821bc8583a71e30d6a27bf29961e2c9dc522 (patch) | |
tree | 5d0ee751af980019549583e73f2741a521e950c2 /cpukit/include/rtems/test.h | |
parent | score: Add _Thread_Dispatch_direct_no_return() (diff) | |
download | rtems-5b97821bc8583a71e30d6a27bf29961e2c9dc522.tar.bz2 |
libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
Diffstat (limited to '')
-rw-r--r-- | cpukit/include/rtems/test.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h index 10ff665107..f95433bc7c 100644 --- a/cpukit/include/rtems/test.h +++ b/cpukit/include/rtems/test.h @@ -89,10 +89,8 @@ typedef struct T_fixture_node { #if defined(__GNUC__) || __STDC_VERSION__ >= 199409L #define T_ZERO_LENGTH_ARRAY -#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) (n) #else #define T_ZERO_LENGTH_ARRAY 1 -#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) ((n) - 1) #endif /** @} */ @@ -2434,22 +2432,26 @@ typedef struct { size_t recorded; size_t capacity; uint64_t switches; +} T_thread_switch_header; + +typedef struct { + T_thread_switch_header header; T_thread_switch_event events[T_ZERO_LENGTH_ARRAY]; } T_thread_switch_log; typedef struct { - T_thread_switch_log log; - T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(2)]; + T_thread_switch_header header; + T_thread_switch_event events[2]; } T_thread_switch_log_2; typedef struct { - T_thread_switch_log log; - T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(4)]; + T_thread_switch_header header; + T_thread_switch_event events[4]; } T_thread_switch_log_4; typedef struct { - T_thread_switch_log log; - T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(10)]; + T_thread_switch_header header; + T_thread_switch_event events[10]; } T_thread_switch_log_10; T_thread_switch_log *T_thread_switch_record(T_thread_switch_log *); |