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

Richi Dubey richidubey at gmail.com
Sun Apr 19 14:59:11 UTC 2020


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?

Thanks,
Richi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200419/016f3d49/attachment.html>


More information about the devel mailing list