NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/51371: GCC warnings breaking rump kernel build



>Number:         51371
>Category:       kern
>Synopsis:       GCC warnings breaking rump kernel build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 28 06:15:00 +0000 2016
>Originator:     David Michael
>Release:        current (2016-07-27)
>Organization:
>Environment:
Fedora 24 x86_64, cross-compiling rumpkernel to GNU Hurd i686
>Description:
There are GCC warnings about bit-shifting negative values and misleading indentation that get turned into errors when building the rump kernel project.  They each have straightforward fixes, and the rump kernel project successfully cross-compiles with the patch applied.

The patch applies against both the rump kernel commit and the current NetBSD CVS.
>How-To-Repeat:
# Fetch rumpkernel projects.
git clone https://github.com/rumpkernel/buildrump.sh
buildrump.sh/buildrump.sh checkout
# Also apply this patch manually if needed: https://github.com/rumpkernel/buildrump.sh/pull/82

# Ensure the branch is up to date.
git -C src checkout buildrump-src
git -C src pull origin buildrump-src
# This is the commit I got: https://github.com/rumpkernel/src-netbsd/commit/974306fcc221f48d4e065360a1ef62939fcef184

# Cross-build with GCC 6.1.0.
CC=i686-pc-gnu-gcc buildrump.sh/buildrump.sh fullbuild
>Fix:
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 4cca7c8..78ba9dc 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -912,9 +912,9 @@ rt_xaddrs(u_char rtmtype, const char *cp, const char *cplim,
 	 */
 	if (rtmtype == RTM_GET) {
 		if (((rtinfo->rti_addrs &
-		    (~((1 << RTAX_IFP) | (1 << RTAX_IFA)))) & (~0 << i)) != 0)
+		    (~((1 << RTAX_IFP) | (1 << RTAX_IFA)))) & (~0U << i)) != 0)
 			return 1;
-	} else if ((rtinfo->rti_addrs & (~0 << i)) != 0)
+	} else if ((rtinfo->rti_addrs & (~0U << i)) != 0)
 		return 1;
 	/* Check for bad data length.  */
 	if (cp != cplim) {
diff --git a/sys/netinet/tcp_vtw.c b/sys/netinet/tcp_vtw.c
index f0a04bf..65487f9 100644
--- a/sys/netinet/tcp_vtw.c
+++ b/sys/netinet/tcp_vtw.c
@@ -1050,7 +1050,7 @@ vtw_next_port_v4(struct tcp_ports_iterator *it)
 			if (!(inuse & (1 << i)))
 				continue;
 
-			inuse &= ~0 << i;
+			inuse &= ~0U << i;
 
 			if (i < it->slot_idx)
 				continue;
@@ -1164,7 +1164,7 @@ vtw_next_port_v6(struct tcp_ports_iterator *it)
 			if (!(inuse & (1 << i)))
 				continue;
 
-			inuse &= ~0 << i;
+			inuse &= ~0U << i;
 
 			if (i < it->slot_idx)
 				continue;
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 46913b8..da57ffe 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -929,7 +929,7 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps,
 				    (flags & PGO_ALLPAGES) != 0)
 					/* need to do a wait or I/O! */
 					done = false;
-					continue;
+				continue;
 			}
 
 			/*



Home | Main Index | Thread Index | Old Index