From: Ivan Maidanski Date: Tue, 18 Oct 2016 22:02:25 +0000 (+0300) Subject: Fix 'variable unused' compiler warning in FirstDLOpenedLinkMap X-Git-Tag: v7.6.2~392 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd830401655dc55649b679cf11c94ceb9f408b45;p=gc Fix 'variable unused' compiler warning in FirstDLOpenedLinkMap * dyn_load.c [!USE_PROC_FOR_LIBRARIES] (GC_FirstDLOpenedLinkMap): Declare dp local variable only if !NETBSD or !RTLD_DI_LINKMAP. --- diff --git a/dyn_load.c b/dyn_load.c index 24ee0c0d..b824a80e 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -680,7 +680,6 @@ extern ElfW(Dyn) _DYNAMIC[]; STATIC struct link_map * GC_FirstDLOpenedLinkMap(void) { - ElfW(Dyn) *dp; static struct link_map *cachedResult = 0; if (0 == (ptr_t)_DYNAMIC) { @@ -700,7 +699,9 @@ GC_FirstDLOpenedLinkMap(void) cachedResult = lm->l_next; } # else + ElfW(Dyn) *dp; int tag; + for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) { if( tag == DT_DEBUG ) { struct link_map *lm