[Midnightbsd-cvs] src [8022] trunk/sys: work around several warnings from clang in XFS.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 15 16:16:58 EDT 2016


Revision: 8022
          http://svnweb.midnightbsd.org/src/?rev=8022
Author:   laffer1
Date:     2016-09-15 16:16:58 -0400 (Thu, 15 Sep 2016)
Log Message:
-----------
work around several warnings from clang in XFS.

Modified Paths:
--------------
    trunk/sys/conf/files
    trunk/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c
    trunk/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c
    trunk/sys/gnu/fs/xfs/FreeBSD/xfs_super.c
    trunk/sys/gnu/fs/xfs/xfs_alloc.c
    trunk/sys/gnu/fs/xfs/xfs_vfsops.c
    trunk/sys/modules/xfs/Makefile

Modified: trunk/sys/conf/files
===================================================================
--- trunk/sys/conf/files	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/conf/files	2016-09-15 20:16:58 UTC (rev 8022)
@@ -3447,7 +3447,7 @@
 gnu/fs/xfs/xfs_dir2.c		optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir2_block.c	optional xfs \
-	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
+	compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir2_data.c	optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir2_leaf.c	optional xfs \
@@ -3455,7 +3455,7 @@
 gnu/fs/xfs/xfs_dir2_node.c	optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir2_sf.c	optional xfs \
-	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
+	compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir2_trace.c	optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/xfs_dir_leaf.c	optional xfs \
@@ -3545,7 +3545,7 @@
 gnu/fs/xfs/FreeBSD/xfs_fs_subr.c	optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/FreeBSD/xfs_ioctl.c	optional xfs \
-	compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
+	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/FreeBSD/support/debug.c	optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
 gnu/fs/xfs/FreeBSD/support/ktrace.c	optional xfs \

Modified: trunk/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c
===================================================================
--- trunk/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c	2016-09-15 20:16:58 UTC (rev 8022)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c,v 1.2 2008/12/03 00:25:55 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  * All Rights Reserved.
@@ -1250,7 +1250,6 @@
 				 XFS_AT_NEXTENTS | XFS_AT_PROJID;
 		XVOP_GETATTR(vp, vattr, 0, NULL, error);
 		if (unlikely(error)) {
-			error = error;
 			break;
 		}
 
@@ -1288,7 +1287,6 @@
 		if (likely(!error))
 			__vn_revalidate(vp, vattr);	/* update flags */
 #endif
-		error = error;
 		break;
 	}
 
@@ -1297,7 +1295,6 @@
 				 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
 		XVOP_GETATTR(vp, vattr, 0, NULL, error);
 		if (unlikely(error)) {
-			error = error;
 			break;
 		}
 
@@ -1348,7 +1345,6 @@
 		if (likely(!error))
 			__vn_revalidate(vp, vattr);	/* update flags */
 #endif
-		error = error;
 		break;
 	}
 

Modified: trunk/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c
===================================================================
--- trunk/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c	2016-09-15 20:16:58 UTC (rev 8022)
@@ -66,7 +66,7 @@
 	};
 
 	for (i=j=len = 0; i < sizeof(xstats)/sizeof(struct xstats_entry); i++) {
-		len += sprintf(buffer + len, xstats[i].desc);
+		len += sprintf(buffer + len, "%s", xstats[i].desc);
 		/* inner loop does each group */
 		while (j < xstats[i].endpoint) {
 			len += sprintf(buffer + len, " %u",

Modified: trunk/sys/gnu/fs/xfs/FreeBSD/xfs_super.c
===================================================================
--- trunk/sys/gnu/fs/xfs/FreeBSD/xfs_super.c	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/gnu/fs/xfs/FreeBSD/xfs_super.c	2016-09-15 20:16:58 UTC (rev 8022)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/gnu/fs/xfs/FreeBSD/xfs_super.c,v 1.2 2008/12/03 00:25:55 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  * All Rights Reserved.
@@ -252,7 +252,7 @@
 int
 init_xfs_fs( void )
 {
-	static char		message[] =
+	static const char	message[] =
 		XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n";
 
 	printf(message);

Modified: trunk/sys/gnu/fs/xfs/xfs_alloc.c
===================================================================
--- trunk/sys/gnu/fs/xfs/xfs_alloc.c	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/gnu/fs/xfs/xfs_alloc.c	2016-09-15 20:16:58 UTC (rev 8022)
@@ -1480,8 +1480,10 @@
 	/*
 	 * Can't allocate from the freelist for some reason.
 	 */
-	else
+	else {
+		fbno = NULLAGBLOCK;
 		flen = 0;
+	}
 	/*
 	 * Can't do the allocation, give up.
 	 */

Modified: trunk/sys/gnu/fs/xfs/xfs_vfsops.c
===================================================================
--- trunk/sys/gnu/fs/xfs/xfs_vfsops.c	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/gnu/fs/xfs/xfs_vfsops.c	2016-09-15 20:16:58 UTC (rev 8022)
@@ -1956,7 +1956,7 @@
 
 	for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
 		if (mp->m_flags & xfs_infop->flag)
-			sbuf_printf(m, xfs_infop->str);
+			sbuf_printf(m, "%s", xfs_infop->str);
 	}
 
 	if (mp->m_flags & XFS_MOUNT_IHASHSIZE)

Modified: trunk/sys/modules/xfs/Makefile
===================================================================
--- trunk/sys/modules/xfs/Makefile	2016-09-15 20:15:56 UTC (rev 8021)
+++ trunk/sys/modules/xfs/Makefile	2016-09-15 20:16:58 UTC (rev 8022)
@@ -6,8 +6,6 @@
 
 KMOD=	 xfs
 
-WERROR=
-
 SRCS =  vnode_if.h \
 	xfs_alloc.c \
 	xfs_alloc_btree.c \
@@ -86,5 +84,6 @@
 	 -I${.CURDIR}/../../gnu/fs/xfs/FreeBSD/support \
 	 -I${.CURDIR}/../../gnu/fs/xfs
 
-CWARNFLAGS.xfs_ioctl.c=		${NO_WSELF_ASSIGN}
+CWARNFLAGS.xfs_dir2_block.c=	${NO_WARRAY_BOUNDS}
+CWARNFLAGS.xfs_dir2_sf.c=	${NO_WARRAY_BOUNDS}
 CWARNFLAGS+=			${CWARNFLAGS.${.IMPSRC:T}}



More information about the Midnightbsd-cvs mailing list