00db10
commit 9114625bad23441c89eac5a7dcf319a9714ca31f
00db10
Author: Joseph Myers <joseph@codesourcery.com>
00db10
Date:   Thu Nov 27 16:00:08 2014 +0000
00db10
00db10
    Fix dlfcn/failtestmod.c warning.
00db10
    
00db10
    This patch fixes a "set but not used" warning from
00db10
    dlfcn/failtestmod.c.  A variable is used only to store the return
00db10
    value from dlsym.  As I understand this test, the point is simply to
00db10
    do a sequence of load / unload operations in a loop, and all that
00db10
    matters here is that dlsym gets called and returns without crashing,
00db10
    not what its return value is.  So this patch removes the assignment to
00db10
    a variable.
00db10
    
00db10
    Tested for x86_64.
00db10
    
00db10
            * dlfcn/failtestmod.c (constr): Do not store result of dlsym in a
00db10
            variable.
00db10
00db10
diff --git a/dlfcn/failtestmod.c b/dlfcn/failtestmod.c
00db10
index a03f90b734132d8d..64dadd53ff8ef109 100644
00db10
--- a/dlfcn/failtestmod.c
00db10
+++ b/dlfcn/failtestmod.c
00db10
@@ -8,7 +8,6 @@ __attribute__ ((__constructor__))
00db10
 constr (void)
00db10
 {
00db10
   void *handle;
00db10
-  void *m;
00db10
 
00db10
   /* Open the library.  */
00db10
   handle = dlopen (NULL, RTLD_NOW);
00db10
@@ -19,7 +18,7 @@ constr (void)
00db10
     }
00db10
 
00db10
   /* Get a symbol.  */
00db10
-  m = dlsym (handle, "main");
00db10
+  dlsym (handle, "main");
00db10
   puts ("called dlsym() to get main");
00db10
 
00db10
   dlclose (handle);