[PATCH] ldso: fix unused variable warning

Baruch Siach baruch at tkos.co.il
Tue Aug 27 08:37:58 UTC 2013


Hi Filippo,

On Tue, Aug 27, 2013 at 10:11:38AM +0200, Filippo ARCIDIACONO wrote:
> On 8/22/2013 4:58 PM, Baruch Siach wrote:
> >This fixes the following warning when SUPPORT_LD_DEBUG_EARLY is not enabled:
> >
> >ldso/ldso/ldso.c: In function '_dl_get_ready_to_run':
> >ldso/ldso/ldso.c:754:16: warning: unused variable 'tmp' [-Wunused-variable]
> >
> >Partially revert commit 94cc6edb (ldso: Rework global scope handling and
> >symbol lookup mechanism).
> >
> >Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> >---
> >  ldso/ldso/ldso.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
> >index 2d7a234..2cad1fb 100644
> >--- a/ldso/ldso/ldso.c
> >+++ b/ldso/ldso/ldso.c
> >@@ -751,11 +751,11 @@ of this helper program; chances are you did not intend to run this program.\n\
> >  	 * case the executable is actually an ET_DYN object.
> >  	 */
> >  	if (app_tpnt->l_tls_initimage != NULL) {
> >-		unsigned int tmp = (unsigned int) app_tpnt->l_tls_initimage;
> >  		app_tpnt->l_tls_initimage =
> >  			(char *) app_tpnt->l_tls_initimage + app_tpnt->loadaddr;
> >  		_dl_debug_early("Relocated TLS initial image from %x to %x (size = %x)\n",
> >-			tmp, app_tpnt->l_tls_initimage, app_tpnt->l_tls_initimage_size);
> >+			(unsigned int) app_tpnt->l_tls_initimage,
> >+			app_tpnt->l_tls_initimage, app_tpnt->l_tls_initimage_size);
> >  	}
> >  #endif
> In this way you have lost the old value of l_tls_initimage because
> it has just been relocated adding the loaddaddr value.
> You cannot do without to use a temporary variable to store the old value.

I'll mark tmp with __attribute__((unused)) then. Is this OK?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the uClibc mailing list