about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@redhat.com>2016-03-15 23:16:47 -0400
committerCarlos O'Donell <carlos@redhat.com>2016-03-15 23:23:24 -0400
commitb4f518ecfad09fc4279ea26a565332835e403dab (patch)
tree56d39c0f69cafc6afc02cc2e81292d37f69cb0b9
parent089b772f98afd9eb6264c6489bc96a30bf6af4ac (diff)
downloadglibc-b4f518ecfad09fc4279ea26a565332835e403dab.tar.gz
glibc-b4f518ecfad09fc4279ea26a565332835e403dab.tar.xz
glibc-b4f518ecfad09fc4279ea26a565332835e403dab.zip
Fix building glibc master with NDEBUG and --with-cpu.
When building on i686, x86_64, and arm, and with NDEBUG, or --with-cpu
there are various variables and functions which are unused based on
these settings.

This patch marks all such variables with __attribute__((unused)) to
avoid the compiler warnings when building with the aformentioned
options.
-rw-r--r--ChangeLog9
-rw-r--r--catgets/tst-catgets.c2
-rw-r--r--dlfcn/bug-dl-leaf-lib.c2
-rw-r--r--math/atest-exp.c2
-rw-r--r--math/atest-exp2.c2
-rw-r--r--sysdeps/arm/dl-machine.h2
-rw-r--r--sysdeps/i386/i686/dl-hash.h1
7 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index db653f5d1a..071a666a89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-03-15  Carlos O'Donell <carlos@redhat.com>
+
+	* catgets/tst-catgets.c (do_bz17905): Mark result unused.
+	* dlfcn/bug-dl-leaf-lib.c (check_val_fini): Mark ret unused.
+	* math/atest-exp.c (exp_mpn): Mark chk unused.
+	* math/atest-exp2.c (exp_mpn): Likwise.
+	* sysdeps/arm/dl-machine.h (elf_machine_rela): Mark td unused.
+	* sysdeps/i386/i686/dl-hash.h: Mark _dl_elf_hash unused.
+
 2016-03-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PPOLL):
diff --git a/catgets/tst-catgets.c b/catgets/tst-catgets.c
index 0886938d53..7169ceb841 100644
--- a/catgets/tst-catgets.c
+++ b/catgets/tst-catgets.c
@@ -22,7 +22,7 @@ do_bz17905 (void)
 {
   char *buf;
   struct rlimit rl;
-  nl_catd result;
+  nl_catd result __attribute__ ((unused));
 
   const int sz = 1024 * 1024;
 
diff --git a/dlfcn/bug-dl-leaf-lib.c b/dlfcn/bug-dl-leaf-lib.c
index d5a3460c2b..105ab244f3 100644
--- a/dlfcn/bug-dl-leaf-lib.c
+++ b/dlfcn/bug-dl-leaf-lib.c
@@ -50,7 +50,7 @@ void check_val_fini (void)
 
 int lib_main (void)
 {
-  int ret;
+  int ret __attribute__ ((unused));
   void *hdl;
 
   /* Make sure the constructor sees the updated val.  */
diff --git a/math/atest-exp.c b/math/atest-exp.c
index ebacff594d..cde4019814 100644
--- a/math/atest-exp.c
+++ b/math/atest-exp.c
@@ -61,7 +61,7 @@ exp_mpn (mp1 ex, mp1 x)
    unsigned n;
    mp1 xp;
    mp2 tmp;
-   mp_limb_t chk;
+   mp_limb_t chk __attribute__ ((unused));
    mp1 tol;
 
    memset (xp, 0, sizeof (mp1));
diff --git a/math/atest-exp2.c b/math/atest-exp2.c
index 395b8f9365..8a9cc70073 100644
--- a/math/atest-exp2.c
+++ b/math/atest-exp2.c
@@ -87,7 +87,7 @@ exp_mpn (mp1 ex, mp1 x)
    unsigned int n;
    mp1 xp;
    mp2 tmp;
-   mp_limb_t chk;
+   mp_limb_t chk __attribute__ ((unused));
    mp1 tol;
 
    memset (xp, 0, sizeof (mp1));
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 0905adda7a..60eee00b5b 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -581,7 +581,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 #  ifdef RESOLVE_CONFLICT_FIND_MAP
 	case R_ARM_TLS_DESC:
 	  {
-	    struct tlsdesc volatile *td =
+	    struct tlsdesc volatile *td __attribute__ ((unused)) =
 	      (struct tlsdesc volatile *) reloc_addr;
 
 	    RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
diff --git a/sysdeps/i386/i686/dl-hash.h b/sysdeps/i386/i686/dl-hash.h
index 8ba85d2a71..dd4458fa89 100644
--- a/sysdeps/i386/i686/dl-hash.h
+++ b/sysdeps/i386/i686/dl-hash.h
@@ -26,6 +26,7 @@
    would be much slower than the generic C implementation.  So don't
    use it.  */
 static unsigned int
+__attribute__ ((unused))
 _dl_elf_hash (const char *name)
 {
   unsigned int result;