Small doubt in a build time warning of sp test of leon3

Joel Sherrill joel at rtems.org
Wed Apr 22 18:58:40 UTC 2020


On Wed, Apr 22, 2020 at 1:55 PM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 22/04/2020 16:12, Joel Sherrill wrote:
>
> > the code I added is an accepted idiom for telling the compiler a
> > variable or parameter is used for its analysis purposes. Does this
> > make sense?
> >
> > diff --git a/cpukit/include/rtems/score/isrlock.h
> > b/cpukit/include/rtems/score/i
> > index 14ea88b..52645a3 100644
> > --- a/cpukit/include/rtems/score/isrlock.h
> > +++ b/cpukit/include/rtems/score/isrlock.h
> > @@ -147,7 +147,7 @@ typedef struct {
> >      { SMP_LOCK_INITIALIZER( _name ) }
> >  #else
> >    #define ISR_LOCK_INITIALIZER( _name ) \
> > -    { }
> > +    { (void) (_name); }
> >  #endif
> For a function-like macro it would be all right, however, this if an
> initializer macro. I guess this test needs some #ifdef RTEMS_SMP to fix
> the warnings.
>

Yeah. I didn't actually compile it. It looked like a function macro
and terminated for uniprocessor systems like that. Other cases
may need indicate something else.

Just another example of how warnings can look easy. :)

--joel

> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200422/6af3593b/attachment.html>


More information about the devel mailing list