This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix unused-variable warnings from MIPS RESOLVE_GOTSYM macro


Building for MIPS produces warnings about the variable "version" in
the RESOLVE_GOTSYM macro being unused when building dl-conflict.c,
where RESOLVE_MAP is defined with a definition that doesn't use that
macro argument.  I've applied this patch to fix these warnings by
using __attribute__ ((unused)) on that variable.

2012-11-19  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/mips/dl-machine.h (RESOLVE_GOTSYM): Declare VERSION
	variable with __attribute__ ((unused)).

diff --git a/ports/sysdeps/mips/dl-machine.h b/ports/sysdeps/mips/dl-machine.h
index cc7da76..9b970a2 100644
--- a/ports/sysdeps/mips/dl-machine.h
+++ b/ports/sysdeps/mips/dl-machine.h
@@ -637,7 +637,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
 #define RESOLVE_GOTSYM(sym,vernum,sym_index,reloc)			  \
     ({									  \
       const ElfW(Sym) *ref = sym;					  \
-      const struct r_found_version *version				  \
+      const struct r_found_version *version __attribute__ ((unused))	  \
 	= vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL;	  \
       struct link_map *sym_map;						  \
       sym_map = RESOLVE_MAP (&ref, version, reloc);			  \

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]