]> granicus.if.org Git - zfs/commitdiff
Only use gcc -Wunused-but-set-variable when available
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 11 Jan 2013 00:09:31 +0000 (16:09 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 11 Jan 2013 00:09:39 +0000 (16:09 -0800)
Certain versions of gcc generate an 'unrecognized command
line option' error message when -Wunused-but-set-variable
is used unconditionally.  This in turn can cause several
of the autoconf tests to misdetect an interface.

Now, the use of -Wunused-but-set-variable in the autoconf
tests was introduced by commit b9c59ec8 to address a gcc
4.6 compatibility problem.  So we really only need to pass
this option for version of gcc which are known to support it.

Therefore, the tests have been updated to use the result of
the existing ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
which determines if gcc supports this option.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1004

20 files changed:
config/kernel-bdev-block-device-operations.m4
config/kernel-bdev-logical-size.m4
config/kernel-bdev-physical-size.m4
config/kernel-blk-end-request.m4
config/kernel-blk-fetch-request.m4
config/kernel-blk-queue-discard.m4
config/kernel-blk-queue-flush.m4
config/kernel-blk-queue-io-opt.m4
config/kernel-blk-queue-max-hw-sectors.m4
config/kernel-blk-queue-max-segments.m4
config/kernel-blk-queue-nonrot.m4
config/kernel-blk-queue-physical-block-size.m4
config/kernel-blk-requeue-request.m4
config/kernel-blk-rq-bytes.m4
config/kernel-blk-rq-pos.m4
config/kernel-blk-rq-sectors.m4
config/kernel-elevator-change.m4
config/kernel-get-disk-ro.m4
config/kernel-rq-for-each_segment.m4
config/kernel-rq-is_sync.m4

index 2805237aa9b376e1896a24a4c70391417e3f44ae..28c3032aa4e740e0bd5dcbbf8aabc85b2b0c459f 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
        AC_MSG_CHECKING([block device operation prototypes])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index d066c863fbd91ce994d1aa2d0f65b506cade04fd..a6194577abbd894c49259e631311df5b6d5a2f44 100644 (file)
@@ -8,7 +8,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE], [
        AC_MSG_CHECKING([whether bdev_logical_block_size() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 0a1fe8e2638536fc764e5a5f90dca918bd66e381..77746ee91690391d82774020fc2b1eee4c26fc8f 100644 (file)
@@ -22,7 +22,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE], [
        AC_MSG_CHECKING([whether bdev_physical_block_size() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 0228fb0f9b93ebaadf13f1ff7aaff388b4303299..ca0a042840bf3076c741af657844658dff1fa86f 100644 (file)
@@ -6,7 +6,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_END_REQUEST], [
        AC_MSG_CHECKING([whether blk_end_request() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index c277f52c086786612df9eaddfe5052e2cafbf58b..c4e11461698bab84e45e5de410ed56d2ec438678 100644 (file)
@@ -8,7 +8,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_FETCH_REQUEST], [
        AC_MSG_CHECKING([whether blk_fetch_request() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 3e5147a519d52581a19d579a101f08eb892b8f79..8306c88ee305b04fb13e7f9f156c64ac377b208f 100644 (file)
@@ -5,7 +5,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [
        AC_MSG_CHECKING([whether blk_queue_discard() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 06561edf699e810fcb6fc957470f46a9b0818452..261174735d9248760e17811873889ca20a4aa839 100644 (file)
@@ -12,7 +12,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
        AC_MSG_CHECKING([whether blk_queue_flush() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 4ea94e1cdbf213afc87e736118c6900368703998..fb9b6841b59cfd70383cb0e15d285e6de0ff91c1 100644 (file)
@@ -6,7 +6,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_IO_OPT], [
        AC_MSG_CHECKING([whether blk_queue_io_opt() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 7bdf7e01799634d704f4d7816ff267dcea12ab28..2f5515dc6b7b0664cacefd95fd3b1e2fca5dd85c 100644 (file)
@@ -5,7 +5,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
        AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 09be121ed10d78162140d7333c350f8e3c2145d8..b2a40423a5c87ef002f9a9feeeb637879d808a05 100644 (file)
@@ -6,7 +6,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
        AC_MSG_CHECKING([whether blk_queue_max_segments() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 45d78f791f64b5ec0277b0f6fd3bbbf93820fdda..aa6d678fed682fd78d9f1b7b68ad0bf596a01d9e 100644 (file)
@@ -8,7 +8,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_NONROT], [
        AC_MSG_CHECKING([whether blk_queue_nonrot() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index c51c81721a25d3eff6391b24f5f05692028d216e..a585b2846bb77072e66aaf73784daeb1aa8a370d 100644 (file)
@@ -7,7 +7,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PHYSICAL_BLOCK_SIZE], [
        AC_MSG_CHECKING([whether blk_queue_physical_block_size() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index d8e7439e02f29b67e6bdf30de153dde0f48d76bc..286c4b9d0ad5f12e18624042a586cb0c656e65ad 100644 (file)
@@ -7,7 +7,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_REQUEUE_REQUEST], [
        AC_MSG_CHECKING([whether blk_requeue_request() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 6430dfe50538b1a4e023958c42bc4d3b55aa6f61..a95f8a8ea390484368f44f36594aabeb7b9fe7ca 100644 (file)
@@ -7,7 +7,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_BYTES], [
        AC_MSG_CHECKING([whether blk_rq_bytes() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index fd8a92657eff1e3bf8358c93c7df0d5a7123ee64..efa595f89b46dd33d8649811758cefabb6e651d7 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_POS], [
        AC_MSG_CHECKING([whether blk_rq_pos() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index fbcd113204c59deede76ec849a11e40ab7e4bcf8..dea5bb5bacc1449453c05329a683861df37b8c87 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_SECTORS], [
        AC_MSG_CHECKING([whether blk_rq_sectors() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 90ab51b2eb770e6f6d4d32861045ea4d9922ecfa..ace5aa82d3d353297604fd1d3ce8fd4e4babbd82 100644 (file)
@@ -5,7 +5,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_ELEVATOR_CHANGE], [
        AC_MSG_CHECKING([whether elevator_change() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
                #include <linux/elevator.h>
index aac69b7a10f25dbf83cd75ed3000b6397b777f47..13ed81217ee3ea472efbc1e237e59dcd039483d7 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_RO], [
        AC_MSG_CHECKING([whether get_disk_ro() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 182147817f453993f10268a900cb9924dcf1ebd6..449168d088eb803e8bf47551b9ee85273cd8ae4f 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_RQ_FOR_EACH_SEGMENT], [
        AC_MSG_CHECKING([whether rq_for_each_segment() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[
index 507bf683e0d77b13b747afd66a3f084dc37158fd..f6f51c87a081db8918bf8b0850b2b50d83a89613 100644 (file)
@@ -4,7 +4,7 @@ dnl #
 AC_DEFUN([ZFS_AC_KERNEL_RQ_IS_SYNC], [
        AC_MSG_CHECKING([whether rq_is_sync() is available])
        tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/blkdev.h>
        ],[