This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch master updated. glibc-2.20-346-g48e435c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  48e435cd93fa55ff415b90fbcdf657ded01e45b6 (commit)
      from  9d9c0019e750b6ef2f6d941e40a4b959c736653c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=48e435cd93fa55ff415b90fbcdf657ded01e45b6

commit 48e435cd93fa55ff415b90fbcdf657ded01e45b6
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Thu Dec 11 07:38:01 2014 -0500

    resolv: Suppress maybe uninitialized warning
    
    In send_vc function at resolv/res_send.c, There is the
    following warning on some architectures:
    
      'resplen' may be used uninitialized in this function
      [-Wmaybe-uninitialized]
    
    And this is a false positive.  This patch suppress the
    compiler warning.

diff --git a/ChangeLog b/ChangeLog
index 9f18f4e..b815868 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2014-12-12  Stefan Liebler  <stli@linux.vnet.ibm.com>
+	    Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* resolv/res_send.c (send_vc): Disable warning resplen may
+	be used uninitialized.
+
+2014-12-12  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
 	* nptl/tst-mutex6.c
 	(ATTR_NULL): New define checks ATTR against NULL.
diff --git a/resolv/res_send.c b/resolv/res_send.c
index af42b8a..4a95eb8 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -96,6 +96,7 @@ static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixi
 #include <string.h>
 #include <unistd.h>
 #include <kernel-features.h>
+#include <libc-internal.h>
 
 #if PACKETSZ > 65536
 #define MAXPACKET       PACKETSZ
@@ -668,7 +669,24 @@ send_vc(res_state statp,
 	// int anssiz = *anssizp;
 	HEADER *anhp = (HEADER *) ans;
 	struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
-	int truncating, connreset, resplen, n;
+	int truncating, connreset, n;
+	/* On some architectures compiler might emit a warning indicating
+	   'resplen' may be used uninitialized.  However if buf2 == NULL
+	   then this code won't be executed; if buf2 != NULL, then first
+	   time round the loop recvresp1 and recvresp2 will be 0 so this
+	   code won't be executed but "thisresplenp = &resplen;" followed
+	   by "*thisresplenp = rlen;" will be executed so that subsequent
+	   times round the loop resplen has been initialized.  So this is
+	   a false-positive.
+	 */
+#if __GNUC_PREREQ (4, 7)
+	DIAG_PUSH_NEEDS_COMMENT;
+	DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
+#endif
+	int resplen;
+#if __GNUC_PREREQ (4, 7)
+	DIAG_POP_NEEDS_COMMENT;
+#endif
 	struct iovec iov[4];
 	u_short len;
 	u_short len2;
@@ -787,6 +805,10 @@ send_vc(res_state statp,
 			/* No buffer allocated for the first
 			   reply.  We can try to use the rest
 			   of the user-provided buffer.  */
+#if __GNUC_PREREQ (4, 7)
+			DIAG_PUSH_NEEDS_COMMENT;
+			DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
+#endif
 #if _STRING_ARCH_unaligned
 			*anssizp2 = orig_anssizp - resplen;
 			*ansp2 = *ansp + resplen;
@@ -797,6 +819,9 @@ send_vc(res_state statp,
 			*anssizp2 = orig_anssizp - aligned_resplen;
 			*ansp2 = *ansp + aligned_resplen;
 #endif
+#if __GNUC_PREREQ (4, 7)
+			DIAG_POP_NEEDS_COMMENT;
+#endif
 		} else {
 			/* The first reply did not fit into the
 			   user-provided buffer.  Maybe the second

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 resolv/res_send.c |   27 ++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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