[PATCH] fixed warning related to spstdc17

zack leung zakthertemsdev at gmail.com
Sat Nov 11 03:03:26 UTC 2023


ping

On Tue, 31 Oct 2023 at 22:07, zack leung <zakthertemsdev at gmail.com> wrote:

> Sorry either I lack knowledge in C or lack knowledge in working with
> rtems. Do you mean if rtems smp is defined then we make sure that scheduler
> context base type is defined? I don't quite understand why it would be
> !defined? And the changes you're referring to are not in the scheduler.h
> file which is where the struct is defined.
>
> On Mon, 30 Oct 2023 at 03:04, Sebastian Huber <
> sebastian.huber at embedded-brains.de> wrote:
>
>> On 29.10.23 02:44, zack leung wrote:
>> > ./../../cpukit/include/rtems/score/schedulerpriority.h:87:21: error:
>> > field 'Base' has incomplete type
>> >     87 |   Scheduler_Context Base;
>> >        |                     ^~~~
>> > ../../../cpukit/include/rtems/score/schedulersimple.h:89:21: error:
>> > field 'Base' has incomplete type
>> >     89 |   Scheduler_Context Base;
>> >        |                     ^~~~
>> >
>> > I get this error when using typedefs
>>
>> Yes, the
>>
>> typedef struct Scheduler_Context Scheduler_Context;
>>
>> only creates the typedef and the structure name. This is why I also wrote:
>>
>> Then you have to make sure that #if !defined(RTEMS_SMP) no objects of
>> this type are used.
>>
>> For example:
>>
>> diff --git a/cpukit/include/rtems/score/schedulersimple.h
>> b/cpukit/include/rtems/score/schedulersimple.h
>> index d9acd3dea0..0db72b2a51 100644
>> --- a/cpukit/include/rtems/score/schedulersimple.h
>> +++ b/cpukit/include/rtems/score/schedulersimple.h
>> @@ -83,10 +83,12 @@ extern "C" {
>>    * @brief Simple scheduler context.
>>    */
>>   typedef struct {
>> +#if !defined(RTEMS_SMP)
>>     /**
>>      * @brief Basic scheduler context.
>>      */
>>     Scheduler_Context Base;
>> +#endif
>>
>>     /**
>>      * @brief One ready queue for all ready threads.
>>
>> --
>> embedded brains GmbH
>> Herr Sebastian HUBER
>> Dornierstr. 4
>> 82178 Puchheim
>> Germany
>> email: sebastian.huber at embedded-brains.de
>> phone: +49-89-18 94 741 - 16
>> fax:   +49-89-18 94 741 - 08
>>
>> Registergericht: Amtsgericht München
>> Registernummer: HRB 157899
>> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
>> Unsere Datenschutzerklärung finden Sie hier:
>> https://embedded-brains.de/datenschutzerklaerung/
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20231110/bd9b1f60/attachment.htm>


More information about the devel mailing list