This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[PATCH] Remove MULTI_PTRS_ARE_ALIASES to fix Wundef warning


The macro has been unconditionally defined as 1 in gethnamaddr.c and
not defined at all in dns-host.c.  As a result, the code excluded by
the macro has been dead for a while (since 1995 for gethnamaddr.c).
Removing the excluded bits do not cause any change to the generated
code on x86_64.

Siddhesh

	* resolv/gethnamaddr.c: Remove definition of
	MULTI_PTRS_ARE_ALIASES.
	(getanswer) [!MULTI_PTRS_ARE_ALIASES]: Remove code.
	* resolv/nss_dns/dns-host.c (getanswer_r)
	[MULTI_PTRS_ARE_ALIASES]: Likewise.

---
 resolv/gethnamaddr.c      | 18 ------------------
 resolv/nss_dns/dns-host.c | 22 ----------------------
 2 files changed, 40 deletions(-)

diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index c73a0dc..9bbed59 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -73,8 +73,6 @@ static char sccsid[] = "@(#)gethostnamadr.c	8.1 (Berkeley) 6/4/93";
 # define LOG_AUTH 0
 #endif
 
-#define MULTI_PTRS_ARE_ALIASES 1	/* XXX - experimental */
-
 #if defined(BSD) && (BSD >= 199103) && defined(AF_INET6)
 # include <stdlib.h>
 # include <string.h>
@@ -359,7 +357,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
 				had_error++;
 				break;
 			}
-#if MULTI_PTRS_ARE_ALIASES
 			cp += n;
 			if (cp != erdata) {
 				__set_h_errno (NO_RECOVERY);
@@ -381,21 +378,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
 				buflen -= n;
 			}
 			break;
-#else
-			host.h_name = bp;
-			if (_res.options & RES_USE_INET6) {
-				n = strlen(bp) + 1;	/* for the \0 */
-				if (n >= MAXHOSTNAMELEN) {
-					had_error++;
-					break;
-				}
-				bp += n;
-				buflen -= n;
-				map_v4v6_hostent(&host, &bp, &buflen);
-			}
-			__set_h_errno (NETDB_SUCCESS);
-			return (&host);
-#endif
 		case T_A:
 		case T_AAAA:
 			if (strcasecmp(host.h_name, bp) != 0) {
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index a5f2c0a..258618e 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -869,27 +869,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 	      ++had_error;
 	      break;
 	    }
-#if MULTI_PTRS_ARE_ALIASES
-	  cp += n;
-	  if (haveanswer == 0)
-	    result->h_name = bp;
-	  else if (ap < &host_data->aliases[MAXALIASES-1])
-	    *ap++ = bp;
-	  else
-	    n = -1;
-	  if (n != -1)
-	    {
-	      n = strlen (bp) + 1;	/* for the \0 */
-	      if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN)
-		{
-		  ++had_error;
-		  break;
-		}
-	      bp += n;
-	      linebuflen -= n;
-	    }
-	  break;
-#else
 	  result->h_name = bp;
 	  if (have_to_map)
 	    {
@@ -906,7 +885,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 	    }
 	  *h_errnop = NETDB_SUCCESS;
 	  return NSS_STATUS_SUCCESS;
-#endif
 	case T_A:
 	case T_AAAA:
 	  if (__builtin_expect (strcasecmp (result->h_name, bp), 0) != 0)
-- 
1.9.3

Attachment: pgpeVrrtYMcrN.pgp
Description: PGP signature


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