Quash some new warnings from GCC 4.6.
authorRoland McGrath <roland@hack.frob.com>
Fri, 10 Jun 2011 19:45:09 +0000 (12:45 -0700)
committerRoland McGrath <roland@hack.frob.com>
Sat, 11 Jun 2011 05:44:20 +0000 (22:44 -0700)
19 files changed:
ChangeLog
Makefile
catgets/gencat.c
elf/dl-open.c
inet/getnetgrent_r.c
io/fts.c
locale/programs/ld-collate.c
locale/programs/ld-ctype.c
locale/programs/locarchive.c
misc/syslog.c
nis/nis_print_group_entry.c
nis/nss_compat/compat-pwd.c
nis/nss_compat/compat-spwd.c
nscd/hstcache.c
posix/bug-regex31.c
resolv/nss_dns/dns-network.c
resolv/res_hconf.c
stdio-common/printf_fp.c
sunrpc/clnt_udp.c

index c5dff272fef4b44a109dfab50452f6e5da0d04ea..8d30749675b55b01328a0ecb95d7e4324a9d199c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
 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: Regenerated.
 
index ea7a5b5e58e8398b14d550d3c419ab242e377f4b..aac255713d9b30c3b1ef70202d149c21c8d83bef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -138,10 +138,16 @@ lib: $(common-objpfx)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)
 
-$(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
        (cd $(common-objpfx)linkobj; \
         $(AR) x ../libc_pic.a; \
index ad677a865f8ba40ebe0a7ca9c4257dafb20b94ea..2a48122fe8deb27ff7f942f5bb8953a70fa0ccc7 100644 (file)
@@ -467,7 +467,6 @@ this is the first definition"));
          else if (strncmp (&this_line[1], "delset", 6) == 0)
            {
              int cnt = sizeof ("delset");
-             size_t set_number;
              while (isspace (this_line[cnt]))
                ++cnt;
 
@@ -489,11 +488,8 @@ this is the first definition"));
                    ++cnt;
 
                  if (cnt == start)
-                   {
-                     error_at_line (0, 0, fname, start_line,
-                                    gettext ("illegal set number"));
-                     set_number = 0;
-                   }
+                   error_at_line (0, 0, fname, start_line,
+                                  gettext ("illegal set number"));
                  else
                    {
                      const char *symbol;
@@ -506,7 +502,6 @@ this is the first definition"));
                      /* We have a symbolic set name.  This name must
                         appear somewhere else in the catalogs read so
                         far.  */
-                     set_number = 0;
                      for (runp = current->all_sets; runp != NULL;
                           runp = runp->next)
                        {
@@ -657,12 +652,10 @@ this is the first definition"));
          else if (ident[0] != '\0')
            {
              struct message_list *runp;
-             struct message_list *lastp;
 
              /* Test whether the symbolic name was not used for
                 another message in this message set.  */
              runp = current->current_set->messages;
-             lastp = NULL;
              while (runp != NULL)
                if (runp->symbol != NULL && strcmp (ident, runp->symbol) == 0)
                  break;
index 8d90b56dca9f8e041505ee8e6221c43a334c00c5..19fda917f36c93ca96712fa7efdfd70d875bb934 100644 (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))
     {
       /* 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)
          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_("\
 no more namespaces available for dlmopen()"));
        }
-
-      if (nsid == GL(dl_nns))
+      else if (nsid == GL(dl_nns))
        {
          __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
          ++GL(dl_nns);
index 38701857cb1f84d949fcaea905e906bef625a670..0bac7b770e80c2cb2fa9e8813f1901ec9f80703d 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, 2005, 2007
-   Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2002,2004,2005,2007,2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    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;
   int result = 0;
   const char *current_group = netgroup;
-  int real_entry = 0;
 
   memset (&entry, '\0', sizeof (entry));
 
@@ -404,8 +403,6 @@ innetgr (const char *netgroup, const char *host, const char *user,
                    }
                  else
                    {
-                     real_entry = 1;
-
                      if ((entry.val.triple.host == NULL || host == NULL
                           || __strcasecmp (entry.val.triple.host, host) == 0)
                          && (entry.val.triple.user == NULL || user == NULL
index 8e628b481d9ba07d5abd7cc76023a63be5212b6b..5ba202b8aa8b66693d8ccdded8641e4cfe5083d5 100644 (file)
--- a/io/fts.c
+++ b/io/fts.c
@@ -748,20 +748,17 @@ mem1:                             saved_errno = errno;
                        p->fts_flags |= FTS_ISW;
 #endif
 
-#if 0
                /* Unreachable code.  cderrno is only ever set to a nonnull
                   value if dirp is closed at the same time.  But then we
                   cannot enter this loop.  */
-               if (cderrno) {
+               if (0 && cderrno) {
                        if (nlinks) {
                                p->fts_info = FTS_NS;
                                p->fts_errno = cderrno;
                        } else
                                p->fts_info = FTS_NSOK;
                        p->fts_accpath = cur->fts_accpath;
-               } else
-#endif
-               if (nlinks == 0
+               } else if (nlinks == 0
 #if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
                           || (nostat &&
                               dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
index b30d1ac9496d0a9a6726b42906f01295dd48be0f..a0a0159a5c82015d21f7b30dcf6c0a43e8c92ffe 100644 (file)
@@ -1987,7 +1987,6 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
     {
       /* As for the singlebyte table, we recognize sequences and
         compress them.  */
-      struct element_t *lastp;
 
       collidx_table_add (atwc.tablewc, ch,
                         -(obstack_object_size (atwc.extrapool)
@@ -2087,7 +2086,6 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
            }
 
          /* Next entry.  */
-         lastp = runp;
          runp = runp->wcnext;
        }
       while (runp != NULL);
index 376a02c2f00eb50d7bad6ff2d9d9ecd45d729843..36d0a99a4c5cf542f954d0da3db94ffb6c891181 100644 (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.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
@@ -2209,7 +2209,6 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
   struct token *now;
   enum token_t nowtok;
   size_t cnt;
-  struct charseq *last_seq;
   uint32_t last_wch = 0;
   enum token_t last_token;
   enum token_t ellipsis_token;
@@ -2465,7 +2464,6 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
                    }
                  else
                    last_str = NULL;
-                 last_seq = seq;
                  last_wch = wch;
                  memcpy (last_charcode, now->val.charcode.bytes, 16);
                  last_charcode_len = now->val.charcode.nbytes;
index 943bc5a6de5ff45bc4207092c897eb7ffc61f6cb..770a731a613d6c8e41924db3eb011e4352811be7 100644 (file)
@@ -300,7 +300,6 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
   void *p;
   unsigned int cnt, loccnt;
   struct namehashent *oldnamehashtab;
-  struct locrecent *oldlocrectab;
   struct locarhandle new_ah;
   size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
   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.  */
   oldnamehashtab = (struct namehashent *) ((char *) ah->addr
                                           + head->namehash_offset);
-  oldlocrectab = (struct locrecent *) ((char *) ah->addr
-                                      + head->locrectab_offset);
 
   /* Sort the old locrec table in order of data position.  */
   struct oldlocrecent oldlocrecarray[head->namehash_size];
index 90cd3bfa14a9d61180203b98d68d50c0b0d8dfae..7156b4f9550292f6f94ff9cc4d57f2a3d2136269 100644 (file)
@@ -141,7 +141,7 @@ __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap)
        FILE *f;
        char *buf = 0;
        size_t bufsize = 0;
-       size_t prioff, msgoff;
+       size_t msgoff;
 #ifndef NO_SIGPIPE
        struct sigaction action, oldaction;
        int sigpipe;
@@ -192,7 +192,7 @@ __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap)
        else
          {
            __fsetlocking (f, FSETLOCKING_BYCALLER);
-           prioff = fprintf (f, "<%d>", pri);
+           fprintf (f, "<%d>", pri);
            (void) time (&now);
            f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr,
                                              f->_IO_write_end
index 11680ae7dc618f73322118d3ba3e125543c868e3..925c950299ac4a3b7f0754f18028ab1ded81bbb5 100644 (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.
    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);
          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
        fputs (_("    No implicit nonmembers\n"), stdout);
index 669522f21a3d55c490ef568705fada4a3dc2a464..6462a85cf3e72f534d914545d109afa8b0a34762 100644 (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.
    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)
     {
-      char *saved_cursor;
-
-      saved_cursor = ent->netgrdata.cursor;
       status = __internal_getnetgrent_r (&host, &user, &domain,
                                         &ent->netgrdata, buffer, buflen,
                                         errnop);
index 95f73559459407093cf8ceecc9d4dae9e1d2b5de..6699259a495b7d2a688d07d72f4f51882b3e637e 100644 (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.
    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)
     {
-      char *saved_cursor;
       enum nss_status status;
 
-      saved_cursor = ent->netgrdata.cursor;
       status = __internal_getnetgrent_r (&host, &user, &domain,
                                         &ent->netgrdata, buffer, buflen,
                                         errnop);
index 101ad2a775a9d20df1a784df4bb99c44cff5d7f7..1ab5860f2dc9c49a44fd671a1e27cda52bb0a5d8 100644 (file)
@@ -190,7 +190,6 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
       size_t h_aliases_cnt;
       uint32_t *h_aliases_len;
       size_t h_addr_list_cnt;
-      int addr_list_type;
       char *addresses;
       char *aliases;
       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);
            }
 
-         addr_list_type = (hst->h_length == NS_INADDRSZ
-                           ? GETHOSTBYADDR : GETHOSTBYADDRv6);
-
          /* NB: the following code is really complicated.  It has
             seemlingly duplicated code paths which do the same.  The
             problem is that we always must add the hash table entry
index 974e8603b9696d0015f96cef29cd0266a505d40e..fc485815fcf67d82d87edced0ad614db49bde85d 100644 (file)
@@ -1,6 +1,7 @@
 #include <mcheck.h>
 #include <regex.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
 int
index c9969e08dcdd694ec87f90adb2ba591e6967d450..b51db9eed4478191f244dbd9557348dbb158b6d7 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, 2007, 2008
-   Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2002,2004,2007,2008,2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    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];
   char **alias_pointer;
   int have_answer;
-  char *ans;
   u_char packtmp[NS_MAXCDNAME];
 
   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 = NULL;
   have_answer = 0;
-  ans = NULL;
 
   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)
        break;
       cp += n;
-      ans = strdupa (bp);
       GETSHORT (type, cp);
       GETSHORT (class, cp);
       cp += INT32SZ;           /* TTL */
index ed55bec29655079502f4519d6f940079091a1c6d..fc4b83f7c3ac1f3f3082d42205a574833e8ea1f5 100644 (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.
    Contributed by David Mosberger (davidm@azstarnet.com).
 
@@ -461,7 +462,7 @@ _res_hconf_reorder_addrs (struct hostent *hp)
 
        cleanup:
          /* Release lock, preserve error value, and close socket.  */
-         save = errno;
+         errno = save;
 
          num_ifs = new_num_ifs;
 
index e9ff1684ce2c3157429016a3dc0a87e901ef9fdc..0a611470bc5d5ccc8d2997390db6d814d00b9a9c 100644 (file)
@@ -640,7 +640,6 @@ ___printf_fp (FILE *fp,
       int exp10 = 0;
       int explog = LDBL_MAX_10_EXP_LOG;
       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. */
       cy = __mpn_lshift (frac, fp_input, fracsize, to_shift);
@@ -762,7 +761,6 @@ ___printf_fp (FILE *fp,
                          fracsize = tmpsize - (i - 1);
                        }
                    }
-                 used_limbs = fracsize - 1;
                }
            }
          --explog;
index 7aa86a64c3c1bbb60e1c41f60c60fcee18dd8e28..83fdd8ef2af2c8ac015b1b7df6344cc1dab0927d 100644 (file)
@@ -172,8 +172,6 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
   cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs));
   if (*sockp < 0)
     {
-      int dontblock = 1;
-
 #ifdef SOCK_NONBLOCK
 # ifndef __ASSUME_SOCK_CLOEXEC
       if (__have_sock_cloexec >= 0)
@@ -212,8 +210,11 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
 # ifdef SOCK_CLOEXEC
       if (__have_sock_cloexec < 0)
 # 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
 #ifdef IP_RECVERR
       {