From: Ivan Maidanski Date: Tue, 18 Oct 2016 22:02:25 +0000 (+0300) Subject: Fix 'variable unused' compiler warning in FirstDLOpenedLinkMap X-Git-Tag: v8.0.0~1093 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=108aaf59c0eefdc6dba5e87936f5931a7bfee95b;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 90b670b1..c9014627 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -683,7 +683,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) { @@ -703,7 +702,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