summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2022-02-16 16:06:08 +0100
committerBrian Behlendorf <behlendorf1@llnl.gov>2022-02-18 09:34:25 -0800
commit72154bd6c9b352fe9f2d9a48c4d45211edd56823 (patch)
tree03546ccb20cf3ea8819ba4364192a4d20939b9f1
parent0ea6510aa006dc88f91fa5f666bfe8943eda4a24 (diff)
libtpool: -Wno-clobbered
Also remove -Wno-unused-but-set-variable Upstream-bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 Reviewed-by: Alejandro Colomar <alx.manpages@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13110
-rw-r--r--config/always-compiler-options.m418
-rw-r--r--config/kernel-blk-queue.m416
-rw-r--r--config/kernel-block-device-operations.m417
-rw-r--r--config/kernel-get-disk-ro.m44
-rw-r--r--config/zfs-build.m42
-rw-r--r--lib/libtpool/Makefile.am2
-rw-r--r--lib/libzfs/Makefile.am1
-rw-r--r--lib/libzpool/Makefile.am3
-rw-r--r--lib/libzutil/Makefile.am2
9 files changed, 34 insertions, 31 deletions
diff --git a/config/always-compiler-options.m4 b/config/always-compiler-options.m4
index 82b351c6e..4b19b52bd 100644
--- a/config/always-compiler-options.m4
+++ b/config/always-compiler-options.m4
@@ -135,7 +135,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION], [
])
dnl #
-dnl # Check if gcc supports -Wno-format-truncation option.
+dnl # Check if gcc supports -Wno-format-zero-length option.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH], [
AC_MSG_CHECKING([whether $CC supports -Wno-format-zero-length])
@@ -183,29 +183,29 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE], [
])
dnl #
-dnl # Check if gcc supports -Wno-unused-but-set-variable option.
+dnl # Check if gcc supports -Wno-clobbered option.
dnl #
-dnl # We actually invoke gcc with the -Wunused-but-set-variable option
+dnl # We actually invoke gcc with the -Wclobbered option
dnl # and infer the 'no-' version does or doesn't exist based upon
dnl # the results. This is required because when checking any of
dnl # no- prefixed options gcc always returns success.
dnl #
-AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE], [
- AC_MSG_CHECKING([whether $CC supports -Wno-unused-but-set-variable])
+AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED], [
+ AC_MSG_CHECKING([whether $CC supports -Wno-clobbered])
saved_flags="$CFLAGS"
- CFLAGS="$CFLAGS -Werror -Wunused-but-set-variable"
+ CFLAGS="$CFLAGS -Werror -Wclobbered"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
- NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
+ NO_CLOBBERED=-Wno-clobbered
AC_MSG_RESULT([yes])
], [
- NO_UNUSED_BUT_SET_VARIABLE=
+ NO_CLOBBERED=
AC_MSG_RESULT([no])
])
CFLAGS="$saved_flags"
- AC_SUBST([NO_UNUSED_BUT_SET_VARIABLE])
+ AC_SUBST([NO_CLOBBERED])
])
dnl #
diff --git a/config/kernel-blk-queue.m4 b/config/kernel-blk-queue.m4
index ff5d2d370..559ae9800 100644
--- a/config/kernel-blk-queue.m4
+++ b/config/kernel-blk-queue.m4
@@ -215,17 +215,17 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
ZFS_LINUX_TEST_SRC([blk_queue_flush], [
#include <linux/blkdev.h>
], [
- struct request_queue *q = NULL;
+ struct request_queue *q __attribute__ ((unused)) = NULL;
(void) blk_queue_flush(q, REQ_FLUSH);
- ], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
+ ], [], [ZFS_META_LICENSE])
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
#include <linux/kernel.h>
#include <linux/blkdev.h>
], [
- struct request_queue *q = NULL;
+ struct request_queue *q __attribute__ ((unused)) = NULL;
blk_queue_write_cache(q, true, true);
- ], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
+ ], [], [ZFS_META_LICENSE])
])
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
@@ -278,9 +278,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS], [
ZFS_LINUX_TEST_SRC([blk_queue_max_hw_sectors], [
#include <linux/blkdev.h>
], [
- struct request_queue *q = NULL;
+ struct request_queue *q __attribute__ ((unused)) = NULL;
(void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
- ], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
@@ -301,9 +301,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS], [
ZFS_LINUX_TEST_SRC([blk_queue_max_segments], [
#include <linux/blkdev.h>
], [
- struct request_queue *q = NULL;
+ struct request_queue *q __attribute__ ((unused)) = NULL;
(void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
- ], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
diff --git a/config/kernel-block-device-operations.m4 b/config/kernel-block-device-operations.m4
index a48618185..84e39dc8a 100644
--- a/config/kernel-block-device-operations.m4
+++ b/config/kernel-block-device-operations.m4
@@ -6,13 +6,16 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
#include <linux/blkdev.h>
unsigned int blk_check_events(struct gendisk *disk,
- unsigned int clearing) { return (0); }
+ unsigned int clearing) {
+ (void) disk, (void) clearing;
+ return (0);
+ }
static const struct block_device_operations
bops __attribute__ ((unused)) = {
.check_events = blk_check_events,
};
- ], [], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
@@ -31,7 +34,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
#include <linux/blkdev.h>
- void blk_release(struct gendisk *g, fmode_t mode) { return; }
+ void blk_release(struct gendisk *g, fmode_t mode) {
+ (void) g, (void) mode;
+ return;
+ }
static const struct block_device_operations
bops __attribute__ ((unused)) = {
@@ -40,7 +46,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
.ioctl = NULL,
.compat_ioctl = NULL,
};
- ], [], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
@@ -61,6 +67,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
#include <linux/blkdev.h>
int blk_revalidate_disk(struct gendisk *disk) {
+ (void) disk;
return(0);
}
@@ -68,7 +75,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
bops __attribute__ ((unused)) = {
.revalidate_disk = blk_revalidate_disk,
};
- ], [], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [], [])
])
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
diff --git a/config/kernel-get-disk-ro.m4 b/config/kernel-get-disk-ro.m4
index 8a379c766..acfcb69ac 100644
--- a/config/kernel-get-disk-ro.m4
+++ b/config/kernel-get-disk-ro.m4
@@ -5,9 +5,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_DISK_RO], [
ZFS_LINUX_TEST_SRC([get_disk_ro], [
#include <linux/blkdev.h>
],[
- struct gendisk *disk = NULL;
+ struct gendisk *disk __attribute__ ((unused)) = NULL;
(void) get_disk_ro(disk);
- ], [$NO_UNUSED_BUT_SET_VARIABLE])
+ ], [])
])
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_RO], [
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index d75867c65..f30c2664c 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -209,7 +209,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
AX_COUNT_CPUS([])
AC_SUBST(CPU_COUNT)
- ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE
+ ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE
ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
diff --git a/lib/libtpool/Makefile.am b/lib/libtpool/Makefile.am
index 40fd137b4..638d427bd 100644
--- a/lib/libtpool/Makefile.am
+++ b/lib/libtpool/Makefile.am
@@ -1,6 +1,8 @@
include $(top_srcdir)/config/Rules.am
AM_CFLAGS += -fvisibility=hidden
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118
+AM_CFLAGS += $(NO_CLOBBERED)
noinst_LTLIBRARIES = libtpool.la
diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am
index e23f7c162..0827d52a4 100644
--- a/lib/libzfs/Makefile.am
+++ b/lib/libzfs/Makefile.am
@@ -6,7 +6,6 @@ VPATH = \
$(top_srcdir)/lib/libzfs
# Suppress unused but set variable warnings often due to ASSERTs
-AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
AM_CFLAGS += $(LIBCRYPTO_CFLAGS) $(ZLIB_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am
index e49577ec4..e60a906a5 100644
--- a/lib/libzpool/Makefile.am
+++ b/lib/libzpool/Makefile.am
@@ -17,9 +17,6 @@ endif
# Unconditionally enable debugging for libzpool
AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
-# Suppress unused but set variable warnings often due to ASSERTs
-AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
-
# Includes kernel code generate warnings for large stack frames
AM_CFLAGS += $(FRAME_LARGER_THAN)
diff --git a/lib/libzutil/Makefile.am b/lib/libzutil/Makefile.am
index b16325061..4f2dbc62b 100644
--- a/lib/libzutil/Makefile.am
+++ b/lib/libzutil/Makefile.am
@@ -1,7 +1,5 @@
include $(top_srcdir)/config/Rules.am
-# Suppress unused but set variable warnings often due to ASSERTs
-AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUDEV_CFLAGS)
AM_CFLAGS += -fvisibility=hidden