[PATCH] fixed warning related to spstdc17

zack leung zakthertemsdev at gmail.com
Sun Oct 29 01:44:52 UTC 2023


./../../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



#if defined(RTEMS_SMP)
typedef struct Scheduler_Context {



    /**
     * @brief Lock to protect this scheduler instance.
     */
    ISR_lock_Control Lock;

    /**
     * @brief The set of processors owned by this scheduler instance.
     */
    Processor_mask Processors;

} Scheduler_Context;
#endif
#if !defined(RTEMS_SMP)
 typedef struct Scheduler_Context Scheduler_Context;
#endif
/**

or

#if defined(RTEMS_SMP)
typedef struct Scheduler_Context {



    /**
     * @brief Lock to protect this scheduler instance.
     */
    ISR_lock_Control Lock;

    /**
     * @brief The set of processors owned by this scheduler instance.
     */
    Processor_mask Processors;

} Scheduler_Context;
#else
 typedef struct Scheduler_Context Scheduler_Context;
#endif
/**

On Fri, 27 Oct 2023 at 01:40, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

>
>
> On 27.10.23 03:43, zack leung wrote:
> > ping
> >
> > On Tue, 24 Oct 2023 at 22:17, zack leung <zakthertemsdev at gmail.com
> > <mailto:zakthertemsdev at gmail.com>> wrote:
> >
> >     that didn't work but i'm thinking of defining a char array that is
> >     equal to the size of the processor lock and the isr lock?
>
> This is a bit complicated and still leads to a size increase.
>
> > i figured
> >     that the processor lock is 64 bits and isr lock is a one bit?
> >     I'm confused on how to make an api define do you have a file i can
> >     look at?
>
> Maybe you try to fix the Scheduler_Context warning first. It is easier
> to fix. I am pretty sure that this approach works:
>
> Get rid of the empty structures is to just provide typedefs, for example:
>
> #if defined(RTEMS_SMP)
> typedef struct Scheduler_Context {
>     ...
> } Scheduler_Context;
> #else
> typedef struct Scheduler_Context Scheduler_Context;
> #endif
>
> Then you have to make sure that #if !defined(RTEMS_SMP) no objects of
> this type are used.
>
> --
> 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/20231028/85952bc3/attachment.htm>


More information about the devel mailing list