git: 0ca977b155ff - stable/13 - Suppress unused variable warning for zfs_fm.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Jul 2022 18:47:29 UTC
The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0ca977b155ff025d2b9dbd49693b95066581271b commit 0ca977b155ff025d2b9dbd49693b95066581271b Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-07-26 20:07:42 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-07-29 18:29:56 +0000 Suppress unused variable warning for zfs_fm.c With clang 15, the following -Werror warning is produced: sys/contrib/openzfs/module/zfs/zfs_fm.c:256:6: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable] int cnt = 0; ^ The 'cnt' variable does not seem to be used for anything, but since this is contributed code, suppress the warning instead. MFC after: 3 days (cherry picked from commit e726e7105685f99b066fcc3908c07157599cd290) --- sys/conf/files | 2 +- sys/modules/zfs/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index a8f79140d7d9..d84810bf4e4d 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -342,7 +342,7 @@ contrib/openzfs/module/zfs/zcp_set.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/zfs/zfeature.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C} ${NO_WUNUSED_BUT_SET_VARIABLE}" contrib/openzfs/module/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/zfs/zfs_log.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index f46f08b2d5d5..6321db2381d8 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -330,7 +330,7 @@ CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier CFLAGS.zap_leaf.c= -Wno-cast-qual CFLAGS.zap_micro.c= -Wno-cast-qual CFLAGS.zcp.c= -Wno-cast-qual -CFLAGS.zfs_fm.c= -Wno-cast-qual +CFLAGS.zfs_fm.c= -Wno-cast-qual ${NO_WUNUSED_BUT_SET_VARIABLE} CFLAGS.zfs_ioctl.c= -Wno-cast-qual CFLAGS.zil.c= -Wno-cast-qual CFLAGS.zio.c= -Wno-cast-qual