From 9149c87ec724ed4e3f45762e771c12f81c3f5a33 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 23 Sep 2016 06:52:33 +0200 Subject: score: Fix C/C++ compatibility issue Only use CPU_Per_CPU_control if it contains at least one filed. In GNU C empty structures have a size of zero. In C++ structures have a non-zero size. In case CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not used anymore. --- cpukit/score/cpu/no_cpu/rtems/score/cpu.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpukit/score/cpu/no_cpu') diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h index 8309bb8b80..a2ae652f60 100644 --- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h +++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h @@ -411,7 +411,11 @@ extern "C" { * @brief The CPU specific per-CPU control. * * The CPU port can place here all state information that must be available and - * maintained for each CPU in the system. + * maintained for each processor in the system. This structure must contain at + * least one field for C/C++ compatibility. In GNU C empty structures have a + * size of zero. In C++ structures have a non-zero size. In case + * CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not + * used. */ typedef struct { /* CPU specific per-CPU state */ -- cgit v1.2.3