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

Richi Dubey richidubey at gmail.com
Wed Apr 22 13:06:31 UTC 2020


Dear Dr. Joel,

Thank you for your reply. I did a grep on the root rtems folder and I came
to know that ISR_LOCK_INITIALIZER is being used by intr.h and isrlock.h
inside leon3's include directory.  It includes various macros like :

#if defined( RTEMS_SMP )
  #define ISR_LOCK_INITIALIZER( _name ) \

and

#define RTEMS_INTERRUPT_LOCK_INITIALIZER( _name ) ISR_LOCK_INITIALIZER(
_name )

I couldn't find the implementation of the function  ISR_LOCK_INITIALIZER( )
anywhere. Is there a isrlock.c present somewhere? I couldn't find any
helpful references for RTEMS_INTERRUPT_LOCK_INITIALIZER too. Am i missing
something?

Please let me know.

Thanks,
Richi.



On Sun, Apr 19, 2020 at 10:52 PM Joel Sherrill <joel at rtems.org> wrote:

>
>
> On Sun, Apr 19, 2020, 9:59 AM Richi Dubey <richidubey at gmail.com> wrote:
>
>> Hey everyone,
>>
>> In the Covid Code-in update by Dr. Joel, he mentioned that the RTEMS
>> could use some help to remove warnings from the code. In the link(
>> https://ftp.rtems.org/pub/rtems/people/joel/warnings/warnings-5-20200408/warnings-all-5-20200408.txt)
>> of warnings for RTEMS 5, one of the warning is:
>>
>> log/sparc-leon3.log:../../../../../../rtems/c/src/../../testsuites/sptests/sp37/init.c:172:21:
>> warning: unused variable 'name' [-Wunused-variable]
>> log/sparc-leon3.log:../../../../../../rtems/c/src/../../testsuites/sptests/sp37/init.c:172:21:
>> warning: 'name' defined but not used [-Wunused-const-variable=]
>>
>>
>> On opening init.c from ~/quick-start/src/rtems/testsuites/sptests/sp37/.
>> Lines 172 to 175 are:
>>
>>  static const char name[] = "test";
>>   ISR_Level normal_interrupt_level = _ISR_Get_level();
>>   ISR_lock_Control initialized = ISR_LOCK_INITIALIZER( name );
>>   ISR_lock_Control zero_initialized;
>>
>> We can see that the name variable is being used in line 174(and later on
>> 3 more times, outside any conditional blocks). Why would Dr. Joel get such
>> a warning then?
>>
>
> Does ISR_LOCK_INITIALIZER actually use the name? It possibly only uses it
> when RTEMS_DEBUG is enabled. Check that.
>
>>
>> Thanks,
>> Richi.
>> _______________________________________________
>> 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/86ae86af/attachment.html>


More information about the devel mailing list