Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Carlos O'Donell committed Mar 16, 2016
1 parent 089b772 commit b4f518e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
9 changes: 9 additions & 0 deletions 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> 2016-03-15 Joseph Myers <joseph@codesourcery.com>


* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PPOLL): * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PPOLL):
Expand Down
2 changes: 1 addition & 1 deletion catgets/tst-catgets.c
Expand Up @@ -22,7 +22,7 @@ do_bz17905 (void)
{ {
char *buf; char *buf;
struct rlimit rl; struct rlimit rl;
nl_catd result; nl_catd result __attribute__ ((unused));


const int sz = 1024 * 1024; const int sz = 1024 * 1024;


Expand Down
2 changes: 1 addition & 1 deletion dlfcn/bug-dl-leaf-lib.c
Expand Up @@ -50,7 +50,7 @@ void check_val_fini (void)


int lib_main (void) int lib_main (void)
{ {
int ret; int ret __attribute__ ((unused));
void *hdl; void *hdl;


/* Make sure the constructor sees the updated val. */ /* Make sure the constructor sees the updated val. */
Expand Down
2 changes: 1 addition & 1 deletion math/atest-exp.c
Expand Up @@ -61,7 +61,7 @@ exp_mpn (mp1 ex, mp1 x)
unsigned n; unsigned n;
mp1 xp; mp1 xp;
mp2 tmp; mp2 tmp;
mp_limb_t chk; mp_limb_t chk __attribute__ ((unused));
mp1 tol; mp1 tol;


memset (xp, 0, sizeof (mp1)); memset (xp, 0, sizeof (mp1));
Expand Down
2 changes: 1 addition & 1 deletion math/atest-exp2.c
Expand Up @@ -87,7 +87,7 @@ exp_mpn (mp1 ex, mp1 x)
unsigned int n; unsigned int n;
mp1 xp; mp1 xp;
mp2 tmp; mp2 tmp;
mp_limb_t chk; mp_limb_t chk __attribute__ ((unused));
mp1 tol; mp1 tol;


memset (xp, 0, sizeof (mp1)); memset (xp, 0, sizeof (mp1));
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/arm/dl-machine.h
Expand Up @@ -581,7 +581,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
# ifdef RESOLVE_CONFLICT_FIND_MAP # ifdef RESOLVE_CONFLICT_FIND_MAP
case R_ARM_TLS_DESC: case R_ARM_TLS_DESC:
{ {
struct tlsdesc volatile *td = struct tlsdesc volatile *td __attribute__ ((unused)) =
(struct tlsdesc volatile *) reloc_addr; (struct tlsdesc volatile *) reloc_addr;


RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr); RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
Expand Down
1 change: 1 addition & 0 deletions sysdeps/i386/i686/dl-hash.h
Expand Up @@ -26,6 +26,7 @@
would be much slower than the generic C implementation. So don't would be much slower than the generic C implementation. So don't
use it. */ use it. */
static unsigned int static unsigned int
__attribute__ ((unused))
_dl_elf_hash (const char *name) _dl_elf_hash (const char *name)
{ {
unsigned int result; unsigned int result;
Expand Down

0 comments on commit b4f518e

Please sign in to comment.