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

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Apr 22 17:58:55 UTC 2020


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.


More information about the devel mailing list