From patchwork Wed Nov 26 21:11:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 3959 Received: (qmail 9696 invoked by alias); 26 Nov 2014 21:11:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 9686 invoked by uid 89); 26 Nov 2014 21:11:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Wed, 26 Nov 2014 21:11:19 +0000 From: Joseph Myers To: Subject: Fix dlfcn/failtestmod.c warning Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 This patch fixes a "set but not used" warning from dlfcn/failtestmod.c. A variable is used only to store the return value from dlsym. As I understand this test, the point is simply to do a sequence of load / unload operations in a loop, and all that matters here is that dlsym gets called and returns without crashing, not what its return value is. So this patch removes the assignment to a variable. Tested for x86_64. 2014-11-26 Joseph Myers * dlfcn/failtestmod.c (constr): Do not store result of dlsym in a variable. diff --git a/dlfcn/failtestmod.c b/dlfcn/failtestmod.c index a03f90b..64dadd5 100644 --- a/dlfcn/failtestmod.c +++ b/dlfcn/failtestmod.c @@ -8,7 +8,6 @@ __attribute__ ((__constructor__)) constr (void) { void *handle; - void *m; /* Open the library. */ handle = dlopen (NULL, RTLD_NOW); @@ -19,7 +18,7 @@ constr (void) } /* Get a symbol. */ - m = dlsym (handle, "main"); + dlsym (handle, "main"); puts ("called dlsym() to get main"); dlclose (handle);