1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Quash some new warnings from GCC 4.6.

This commit is contained in:
Roland McGrath
2011-06-10 12:45:09 -07:00
parent b68e08db76
commit 5615eaf264
19 changed files with 74 additions and 60 deletions

View File

@ -1,5 +1,42 @@
2011-06-10 Roland McGrath <roland@hack.frob.com> 2011-06-10 Roland McGrath <roland@hack.frob.com>
* Makefile ($(common-objpfx)linkobj/libc.so): Break long lines with \.
Don't list ld.so twice in dependencies.
* posix/bug-regex31.c: Include <stdlib.h>.
* nscd/hstcache.c (cache_addhst): Remove unused variable.
* nis/nss_compat/compat-spwd.c
(getspent_next_nss_netgr): Remove unused variable.
* nis/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Likewise.
* nis/nis_print_group_entry.c (nis_print_group_entry): Fix "Implicit
nonmembers" output to use the right array.
* resolv/nss_dns/dns-network.c (getanswer_r): Remove unused variable.
* elf/dl-open.c (_dl_open): Quash warnings when DL_NNS==1.
* locale/programs/ld-ctype.c (ctype_read): Remove unused variable.
* locale/programs/ld-collate.c (add_to_tablewc): Likewise.
* catgets/gencat.c (read_input_file): Likewise.
* locale/programs/locarchive.c (enlarge_archive): Likewise.
* sunrpc/clnt_udp.c (__libc_clntudp_bufcreate): Move DONTBLOCK
variable definition inside #if's controlling its use.
* inet/getnetgrent_r.c (innetgr): Remove unused variable.
* resolv/res_hconf.c (_res_hconf_reorder_addrs): Fix errno restoration.
* misc/syslog.c (__vsyslog_chk): Remove unused variable.
* io/fts.c (fts_build): Use if (0 && ...) rather than #if 0 for
unreachable code.
* stdio-common/printf_fp.c (___printf_fp): Remove unused variable.
* configure.in (nss-crypt check): Use AC_LANG_PROGRAM. * configure.in (nss-crypt check): Use AC_LANG_PROGRAM.
* configure: Regenerated. * configure: Regenerated.

View File

@ -138,10 +138,16 @@ lib: $(common-objpfx)libc.so
lib: $(common-objpfx)linkobj/libc.so lib: $(common-objpfx)linkobj/libc.so
$(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os $(common-objpfx)linkobj/libc_pic.a $(elfobjdir)/sofini.os $(elfobjdir)/interp.os $(elfobjdir)/ld.so $(common-objpfx)shlib.lds $(common-objpfx)elf/ld.so $(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \
$(common-objpfx)linkobj/libc_pic.a \
$(elfobjdir)/sofini.os \
$(elfobjdir)/interp.os \
$(elfobjdir)/ld.so \
$(common-objpfx)shlib.lds
$(build-shlib) $(build-shlib)
$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a $(common-objpfx)sunrpc/librpc_compat_pic.a $(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a \
$(common-objpfx)sunrpc/librpc_compat_pic.a
$(..)./scripts/mkinstalldirs $(common-objpfx)linkobj $(..)./scripts/mkinstalldirs $(common-objpfx)linkobj
(cd $(common-objpfx)linkobj; \ (cd $(common-objpfx)linkobj; \
$(AR) x ../libc_pic.a; \ $(AR) x ../libc_pic.a; \

View File

@ -467,7 +467,6 @@ this is the first definition"));
else if (strncmp (&this_line[1], "delset", 6) == 0) else if (strncmp (&this_line[1], "delset", 6) == 0)
{ {
int cnt = sizeof ("delset"); int cnt = sizeof ("delset");
size_t set_number;
while (isspace (this_line[cnt])) while (isspace (this_line[cnt]))
++cnt; ++cnt;
@ -489,11 +488,8 @@ this is the first definition"));
++cnt; ++cnt;
if (cnt == start) if (cnt == start)
{ error_at_line (0, 0, fname, start_line,
error_at_line (0, 0, fname, start_line, gettext ("illegal set number"));
gettext ("illegal set number"));
set_number = 0;
}
else else
{ {
const char *symbol; const char *symbol;
@ -506,7 +502,6 @@ this is the first definition"));
/* We have a symbolic set name. This name must /* We have a symbolic set name. This name must
appear somewhere else in the catalogs read so appear somewhere else in the catalogs read so
far. */ far. */
set_number = 0;
for (runp = current->all_sets; runp != NULL; for (runp = current->all_sets; runp != NULL;
runp = runp->next) runp = runp->next)
{ {
@ -657,12 +652,10 @@ this is the first definition"));
else if (ident[0] != '\0') else if (ident[0] != '\0')
{ {
struct message_list *runp; struct message_list *runp;
struct message_list *lastp;
/* Test whether the symbolic name was not used for /* Test whether the symbolic name was not used for
another message in this message set. */ another message in this message set. */
runp = current->current_set->messages; runp = current->current_set->messages;
lastp = NULL;
while (runp != NULL) while (runp != NULL)
if (runp->symbol != NULL && strcmp (ident, runp->symbol) == 0) if (runp->symbol != NULL && strcmp (ident, runp->symbol) == 0)
break; break;

View File

@ -516,7 +516,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
if (__builtin_expect (nsid == LM_ID_NEWLM, 0)) if (__builtin_expect (nsid == LM_ID_NEWLM, 0))
{ {
/* Find a new namespace. */ /* Find a new namespace. */
for (nsid = 1; nsid < GL(dl_nns); ++nsid) for (nsid = 1; DL_NNS > 1 && nsid < GL(dl_nns); ++nsid)
if (GL(dl_ns)[nsid]._ns_loaded == NULL) if (GL(dl_ns)[nsid]._ns_loaded == NULL)
break; break;
@ -528,8 +528,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
_dl_signal_error (EINVAL, file, NULL, N_("\ _dl_signal_error (EINVAL, file, NULL, N_("\
no more namespaces available for dlmopen()")); no more namespaces available for dlmopen()"));
} }
else if (nsid == GL(dl_nns))
if (nsid == GL(dl_nns))
{ {
__rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock); __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++GL(dl_nns); ++GL(dl_nns);

View File

@ -1,5 +1,5 @@
/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, 2005, 2007 /* Copyright (C) 1996,1997,1998,1999,2002,2004,2005,2007,2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -347,7 +347,6 @@ innetgr (const char *netgroup, const char *host, const char *user,
struct __netgrent entry; struct __netgrent entry;
int result = 0; int result = 0;
const char *current_group = netgroup; const char *current_group = netgroup;
int real_entry = 0;
memset (&entry, '\0', sizeof (entry)); memset (&entry, '\0', sizeof (entry));
@ -404,8 +403,6 @@ innetgr (const char *netgroup, const char *host, const char *user,
} }
else else
{ {
real_entry = 1;
if ((entry.val.triple.host == NULL || host == NULL if ((entry.val.triple.host == NULL || host == NULL
|| __strcasecmp (entry.val.triple.host, host) == 0) || __strcasecmp (entry.val.triple.host, host) == 0)
&& (entry.val.triple.user == NULL || user == NULL && (entry.val.triple.user == NULL || user == NULL

View File

@ -748,20 +748,17 @@ mem1: saved_errno = errno;
p->fts_flags |= FTS_ISW; p->fts_flags |= FTS_ISW;
#endif #endif
#if 0
/* Unreachable code. cderrno is only ever set to a nonnull /* Unreachable code. cderrno is only ever set to a nonnull
value if dirp is closed at the same time. But then we value if dirp is closed at the same time. But then we
cannot enter this loop. */ cannot enter this loop. */
if (cderrno) { if (0 && cderrno) {
if (nlinks) { if (nlinks) {
p->fts_info = FTS_NS; p->fts_info = FTS_NS;
p->fts_errno = cderrno; p->fts_errno = cderrno;
} else } else
p->fts_info = FTS_NSOK; p->fts_info = FTS_NSOK;
p->fts_accpath = cur->fts_accpath; p->fts_accpath = cur->fts_accpath;
} else } else if (nlinks == 0
#endif
if (nlinks == 0
#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE #if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
|| (nostat && || (nostat &&
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)

View File

@ -1987,7 +1987,6 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
{ {
/* As for the singlebyte table, we recognize sequences and /* As for the singlebyte table, we recognize sequences and
compress them. */ compress them. */
struct element_t *lastp;
collidx_table_add (atwc.tablewc, ch, collidx_table_add (atwc.tablewc, ch,
-(obstack_object_size (atwc.extrapool) -(obstack_object_size (atwc.extrapool)
@ -2087,7 +2086,6 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
} }
/* Next entry. */ /* Next entry. */
lastp = runp;
runp = runp->wcnext; runp = runp->wcnext;
} }
while (runp != NULL); while (runp != NULL);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1995-2006, 2007, 2009 Free Software Foundation, Inc. /* Copyright (C) 1995-2006,2007,2009,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995. Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
@ -2209,7 +2209,6 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
struct token *now; struct token *now;
enum token_t nowtok; enum token_t nowtok;
size_t cnt; size_t cnt;
struct charseq *last_seq;
uint32_t last_wch = 0; uint32_t last_wch = 0;
enum token_t last_token; enum token_t last_token;
enum token_t ellipsis_token; enum token_t ellipsis_token;
@ -2465,7 +2464,6 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
} }
else else
last_str = NULL; last_str = NULL;
last_seq = seq;
last_wch = wch; last_wch = wch;
memcpy (last_charcode, now->val.charcode.bytes, 16); memcpy (last_charcode, now->val.charcode.bytes, 16);
last_charcode_len = now->val.charcode.nbytes; last_charcode_len = now->val.charcode.nbytes;

View File

@ -300,7 +300,6 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
void *p; void *p;
unsigned int cnt, loccnt; unsigned int cnt, loccnt;
struct namehashent *oldnamehashtab; struct namehashent *oldnamehashtab;
struct locrecent *oldlocrectab;
struct locarhandle new_ah; struct locarhandle new_ah;
size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
@ -431,8 +430,6 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
still referenced and transfer it into the new file. */ still referenced and transfer it into the new file. */
oldnamehashtab = (struct namehashent *) ((char *) ah->addr oldnamehashtab = (struct namehashent *) ((char *) ah->addr
+ head->namehash_offset); + head->namehash_offset);
oldlocrectab = (struct locrecent *) ((char *) ah->addr
+ head->locrectab_offset);
/* Sort the old locrec table in order of data position. */ /* Sort the old locrec table in order of data position. */
struct oldlocrecent oldlocrecarray[head->namehash_size]; struct oldlocrecent oldlocrecarray[head->namehash_size];

View File

@ -141,7 +141,7 @@ __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap)
FILE *f; FILE *f;
char *buf = 0; char *buf = 0;
size_t bufsize = 0; size_t bufsize = 0;
size_t prioff, msgoff; size_t msgoff;
#ifndef NO_SIGPIPE #ifndef NO_SIGPIPE
struct sigaction action, oldaction; struct sigaction action, oldaction;
int sigpipe; int sigpipe;
@ -192,7 +192,7 @@ __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap)
else else
{ {
__fsetlocking (f, FSETLOCKING_BYCALLER); __fsetlocking (f, FSETLOCKING_BYCALLER);
prioff = fprintf (f, "<%d>", pri); fprintf (f, "<%d>", pri);
(void) time (&now); (void) time (&now);
f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr, f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr,
f->_IO_write_end f->_IO_write_end

View File

@ -1,4 +1,5 @@
/* Copyright (c) 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. /* Copyright (c) 1997,1998,2000,2004,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@ -156,7 +157,7 @@ nis_print_group_entry (const_nis_name group)
{ {
fputs (_(" Implicit nonmembers:\n"), stdout); fputs (_(" Implicit nonmembers:\n"), stdout);
for (i = 0; i < nomem_imp_cnt; ++i) for (i = 0; i < nomem_imp_cnt; ++i)
printf ("\t%s\n", &mem_imp[i][3]); printf ("\t%s\n", &nomem_imp[i][3]);
} }
else else
fputs (_(" No implicit nonmembers\n"), stdout); fputs (_(" No implicit nonmembers\n"), stdout);

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc. /* Copyright (C) 1996-1999,2001-2006,2007,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -386,9 +387,6 @@ getpwent_next_nss_netgr (const char *name, struct passwd *result, ent_t *ent,
while (1) while (1)
{ {
char *saved_cursor;
saved_cursor = ent->netgrdata.cursor;
status = __internal_getnetgrent_r (&host, &user, &domain, status = __internal_getnetgrent_r (&host, &user, &domain,
&ent->netgrdata, buffer, buflen, &ent->netgrdata, buffer, buflen,
errnop); errnop);

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc. /* Copyright (C) 1996-1999,2001-2006,2007,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -344,10 +345,8 @@ getspent_next_nss_netgr (const char *name, struct spwd *result, ent_t *ent,
while (1) while (1)
{ {
char *saved_cursor;
enum nss_status status; enum nss_status status;
saved_cursor = ent->netgrdata.cursor;
status = __internal_getnetgrent_r (&host, &user, &domain, status = __internal_getnetgrent_r (&host, &user, &domain,
&ent->netgrdata, buffer, buflen, &ent->netgrdata, buffer, buflen,
errnop); errnop);

View File

@ -190,7 +190,6 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
size_t h_aliases_cnt; size_t h_aliases_cnt;
uint32_t *h_aliases_len; uint32_t *h_aliases_len;
size_t h_addr_list_cnt; size_t h_addr_list_cnt;
int addr_list_type;
char *addresses; char *addresses;
char *aliases; char *aliases;
char *key_copy = NULL; char *key_copy = NULL;
@ -409,9 +408,6 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
+ total + req->key_len, MS_ASYNC); + total + req->key_len, MS_ASYNC);
} }
addr_list_type = (hst->h_length == NS_INADDRSZ
? GETHOSTBYADDR : GETHOSTBYADDRv6);
/* NB: the following code is really complicated. It has /* NB: the following code is really complicated. It has
seemlingly duplicated code paths which do the same. The seemlingly duplicated code paths which do the same. The
problem is that we always must add the hash table entry problem is that we always must add the hash table entry

View File

@ -1,6 +1,7 @@
#include <mcheck.h> #include <mcheck.h>
#include <regex.h> #include <regex.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
int int

View File

@ -1,5 +1,5 @@
/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, 2007, 2008 /* Copyright (C) 1996,1997,1998,1999,2002,2004,2007,2008,2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996. Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -293,7 +293,6 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
const unsigned char *cp = &answer->buf[HFIXEDSZ]; const unsigned char *cp = &answer->buf[HFIXEDSZ];
char **alias_pointer; char **alias_pointer;
int have_answer; int have_answer;
char *ans;
u_char packtmp[NS_MAXCDNAME]; u_char packtmp[NS_MAXCDNAME];
if (question_count == 0) if (question_count == 0)
@ -328,7 +327,6 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
alias_pointer = result->n_aliases = &net_data->aliases[0]; alias_pointer = result->n_aliases = &net_data->aliases[0];
*alias_pointer = NULL; *alias_pointer = NULL;
have_answer = 0; have_answer = 0;
ans = NULL;
while (--answer_count >= 0 && cp < end_of_message) while (--answer_count >= 0 && cp < end_of_message)
{ {
@ -351,7 +349,6 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
if (n < 0 || res_dnok (bp) == 0) if (n < 0 || res_dnok (bp) == 0)
break; break;
cp += n; cp += n;
ans = strdupa (bp);
GETSHORT (type, cp); GETSHORT (type, cp);
GETSHORT (class, cp); GETSHORT (class, cp);
cp += INT32SZ; /* TTL */ cp += INT32SZ; /* TTL */

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1993, 1995-2006, 2007, 2009 Free Software Foundation, Inc. /* Copyright (C) 1993,1995-2006,2007,2009,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by David Mosberger (davidm@azstarnet.com). Contributed by David Mosberger (davidm@azstarnet.com).
@ -461,7 +462,7 @@ _res_hconf_reorder_addrs (struct hostent *hp)
cleanup: cleanup:
/* Release lock, preserve error value, and close socket. */ /* Release lock, preserve error value, and close socket. */
save = errno; errno = save;
num_ifs = new_num_ifs; num_ifs = new_num_ifs;

View File

@ -640,7 +640,6 @@ ___printf_fp (FILE *fp,
int exp10 = 0; int exp10 = 0;
int explog = LDBL_MAX_10_EXP_LOG; int explog = LDBL_MAX_10_EXP_LOG;
const struct mp_power *powers = &_fpioconst_pow10[explog + 1]; const struct mp_power *powers = &_fpioconst_pow10[explog + 1];
mp_size_t used_limbs = fracsize - 1;
/* Now shift the input value to its right place. */ /* Now shift the input value to its right place. */
cy = __mpn_lshift (frac, fp_input, fracsize, to_shift); cy = __mpn_lshift (frac, fp_input, fracsize, to_shift);
@ -762,7 +761,6 @@ ___printf_fp (FILE *fp,
fracsize = tmpsize - (i - 1); fracsize = tmpsize - (i - 1);
} }
} }
used_limbs = fracsize - 1;
} }
} }
--explog; --explog;

View File

@ -172,8 +172,6 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs)); cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs));
if (*sockp < 0) if (*sockp < 0)
{ {
int dontblock = 1;
#ifdef SOCK_NONBLOCK #ifdef SOCK_NONBLOCK
# ifndef __ASSUME_SOCK_CLOEXEC # ifndef __ASSUME_SOCK_CLOEXEC
if (__have_sock_cloexec >= 0) if (__have_sock_cloexec >= 0)
@ -212,8 +210,11 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
# ifdef SOCK_CLOEXEC # ifdef SOCK_CLOEXEC
if (__have_sock_cloexec < 0) if (__have_sock_cloexec < 0)
# endif # endif
/* the sockets rpc controls are non-blocking */ {
(void) __ioctl (*sockp, FIONBIO, (char *) &dontblock); /* the sockets rpc controls are non-blocking */
int dontblock = 1;
(void) __ioctl (*sockp, FIONBIO, (char *) &dontblock);
}
#endif #endif
#ifdef IP_RECVERR #ifdef IP_RECVERR
{ {