Module Name:    src
Committed By:   mrg
Date:           Sun Feb  4 09:03:23 UTC 2018

Modified Files:
        src/libexec/identd: Makefile
        src/sbin/newfs_msdos: mkfs_msdos.c
        src/sbin/sysctl: sysctl.c

Log Message:
updates for GCC 6.4:

identd has aliasing violations, use -fno-strict-aliasing.

newfs_msdos's getbpbinfo() has missing {} issues.

sysctl's kern_cp_id() has missing {} issues.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/libexec/identd/Makefile
cvs rdiff -u -r1.13 -r1.14 src/sbin/newfs_msdos/mkfs_msdos.c
cvs rdiff -u -r1.159 -r1.160 src/sbin/sysctl/sysctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/identd/Makefile
diff -u src/libexec/identd/Makefile:1.15 src/libexec/identd/Makefile:1.16
--- src/libexec/identd/Makefile:1.15	Sun Dec 11 15:43:48 2016
+++ src/libexec/identd/Makefile	Sun Feb  4 09:03:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2016/12/11 15:43:48 christos Exp $
+# $NetBSD: Makefile,v 1.16 2018/02/04 09:03:23 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -26,4 +26,7 @@ LDADD+=-lnpf -lprop
 DPADD+=${LIBNPF} ${LIBPROP}
 .endif
 
+# XXX
+COPTS+=	-fno-strict-aliasing
+
 .include <bsd.prog.mk>

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.13 src/sbin/newfs_msdos/mkfs_msdos.c:1.14
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.13	Fri Apr 14 15:39:29 2017
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Sun Feb  4 09:03:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.13 2017/04/14 15:39:29 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.14 2018/02/04 09:03:23 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -37,7 +37,7 @@
 static const char rcsid[] =
   "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
 #else
-__RCSID("$NetBSD: mkfs_msdos.c,v 1.13 2017/04/14 15:39:29 christos Exp $");
+__RCSID("$NetBSD: mkfs_msdos.c,v 1.14 2018/02/04 09:03:23 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -896,10 +896,11 @@ getbpbinfo(int fd, const char *fname, co
 	    return -1;
 	bpb->spt = nsectors;
     }
-    if (!bpb->hds)
+    if (!bpb->hds) {
 	if (ckgeom(fname, ntracks, "drive heads") == -1)
 	    return -1;
 	bpb->hds = ntracks;
+    }
     if (!bpb->bsec)
 	bpb->bsec = size;
 

Index: src/sbin/sysctl/sysctl.c
diff -u src/sbin/sysctl/sysctl.c:1.159 src/sbin/sysctl/sysctl.c:1.160
--- src/sbin/sysctl/sysctl.c:1.159	Thu Apr 13 14:46:32 2017
+++ src/sbin/sysctl/sysctl.c	Sun Feb  4 09:03:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.c,v 1.159 2017/04/13 14:46:32 christos Exp $ */
+/*	$NetBSD: sysctl.c,v 1.160 2018/02/04 09:03:23 mrg Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = "@(#)sysctl.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.159 2017/04/13 14:46:32 christos Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.160 2018/02/04 09:03:23 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -2454,12 +2454,13 @@ kern_cp_id(HANDLER_ARGS)
 			       sizeof(u_int64_t),
 			       DISPLAY_VALUE);
 	else if (Aflag) {
-		for (i = 0; i < n; i++)
+		for (i = 0; i < n; i++) {
 			(void)snprintf(s, sizeof(s), "%s%s%d", sname, sep, i);
 			tname = s;
 			display_number(&node, tname, &cp_id[i],
 				       sizeof(u_int64_t),
 				       DISPLAY_VALUE);
+		}
 	}
 	else {
 		if (xflag || rflag)

Reply via email to