[PATCH] Removes build time warning for all the bsps using libtests/dl10 test

Gedare Bloom gedare at rtems.org
Fri Apr 24 14:16:19 UTC 2020


Whenever you fix a warning something is unused by deleting that
something, you should first make sure that something isn't supposed to
be used. Because that might also be the problem. Check if these 2
functions maybe should be tested, or does dlsym/dlclose get tested
elsewhere?

On Fri, Apr 24, 2020 at 7:33 AM Richi Dubey <richidubey at gmail.com> wrote:
>
> Hey,
>
> Can someone please check if this patch is correct? The warnings were:
>
> log/sparc-leon3.log:../../../../../../rtems/c/src/../../testsuites/libtests/dl10/dl-load.c:109:12:
> warning: 'dl_call' defined but not used [-Wunused-function]
>
> log/sparc-leon3.log:../../../../../../rtems/c/src/../../testsuites/libtests/dl10/dl-load.c:99:13:
> warning: 'dl_close' defined but not used [-Wunused-function]
>
> I looked around and it seemed fine to delete these functions because
> they weren't being called. Is it fine to remove them? I rebuilt the
> leon3 bsp successfully with the new changes with no errors.
>
> ----------------------------------------------------------------------------------------------------------
>
> From ce902f7107eab8485e8f7ba7b7ac8c37013d7a30 Mon Sep 17 00:00:00 2001
> From: Richi Dubey <richidubey at gmail.com>
> Date: Fri, 24 Apr 2020 18:42:16 +0530
> Subject: [PATCH 2/2] Removed dl_call and dl_close
>
> ---
>  testsuites/libtests/dl10/dl-load.c | 21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)
>
> diff --git a/testsuites/libtests/dl10/dl-load.c
> b/testsuites/libtests/dl10/dl-load.c
> index dee1d6e9cc..d3fed3d69f 100644
> --- a/testsuites/libtests/dl10/dl-load.c
> +++ b/testsuites/libtests/dl10/dl-load.c
> @@ -96,27 +96,8 @@ static void* dl_load_obj(const char* name, bool
> has_unresolved)
>    return handle;
>  }
>
> -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;
> -}
> +
>
>  int dl_load_test(void)
>  {
> --
> 2.17.1
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list