unused static functions
Joel Sherrill
joel at rtems.org
Tue Aug 4 17:28:50 UTC 2020
On Tue, Aug 4, 2020 at 11:12 AM Gedare Bloom <gedare at rtems.org> wrote:
> Hello Aschref Ben thabet,
>
> On Tue, Aug 4, 2020 at 6:35 AM Aschref Ben-Thabet
> <aschref.ben-thabet at embedded-brains.de> wrote:
> >
> > Dear RTEMS developers Team,
> > i am a new member focusing now on fixing the GCC10 warnings
> Compiler.this last has told that these both functions are declared but not
> used.
> > In /rtems/testsuites/libtests/dl10/dl-load.c,the test file includes this
> both functions without further use. that can generate a warning like
> Wunused-function.
> > can you tell me please for which issue are these static functions in
> this test file declared, and when they have any effect in the test, is it
> helpful to erase them (it fixes the warning)?
>
> I think these functions are just copied from other dltests. Chris
> Johns may comment on their elimination.
>
> You would want to look at the purpose of the test, and how similar
> tests are structured. Was it a mistake not to call these functions? Or
> are they not needed for this test?
>
The inclusion of these may generate special relocation records. Chris
would know that.
If they have to be there, there are examples on how to disable a specific
warning around a block of code.
>
> > static void dl_close (void* handle)
> > {
> > int r;
> > printf ("handle: %p closing\n", handle);
> > r = dlclose (handle);
> > if (r != 0)
> > printf("dlclose failed: %s\n", dlerror()) ;
> > rtems_test_assert (r == 0);
> > }
> > static int dl_call (void* handle, const char* func)
> > {
> > call_sig call = dlsym (handle, func);
> > if (call == NULL)
> > {
> > printf("dlsym failed: symbol not found: %s\n", func);
> > return 1;
> > }
> > call ();
> > return 0;
> > }
>
> It may be helpful to avoid html markup in mailing lists. We don't
> filter it out, but some mailing lists (and clients) may.
>
> > Beste regards
> > Aschref Ben thabet
> > Embedded Brains GmbH
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> 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/20200804/4b8405ca/attachment.html>
More information about the devel
mailing list