Only use gcc -Wunused-but-set-variable when available

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
This commit is contained in:
Brian Behlendorf 2013-01-10 16:09:31 -08:00
parent 9566fb1a7b
commit e191b54ecf
20 changed files with 20 additions and 20 deletions

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>
],[

View 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>

View 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>
],[

View 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>
],[

View 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>
],[