aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-04-19 10:02:21 -0700
committerBrian Behlendorf <[email protected]>2011-04-19 10:10:47 -0700
commit79713039a2b6e0ed223d141b4a8a8455f282d2f2 (patch)
tree0412c6b2e5794ff3d8b7500d5c30959cd7795a41
parent03514b01109e0a6ef4eee4914ba7442c380fa6b4 (diff)
Fix gcc configure warnings
Newer versions of gcc are getting smart enough to detect the sloppy syntax used for the autoconf tests. It is now generating warnings for unused/undeclared variables. Newer version of gcc even have the -Wunused-but-set-variable option set by default. This isn't a problem except when -Werror is set and they get promoted to an error. In this case the autoconf test will return an incorrect result which will result in a build failure latter on. To handle this I'm tightening up many of the autoconf tests to explicitly mark variables as unused to suppress the gcc warning. Remember, all of the autoconf code can never actually be run we just want to get a clean build error to detect which APIs are available. Never using a variable is absolutely fine for this. Closes #176
-rw-r--r--config/kernel-bio-end-io-t-args.m42
-rw-r--r--config/kernel-bio-failfast.m46
-rw-r--r--config/kernel-bio-rw-syncio.m46
-rw-r--r--config/kernel-evict-inode.m42
-rw-r--r--config/kernel-fmode-t.m42
-rw-r--r--config/kernel-fsync.m42
-rw-r--r--config/kernel-invalidate-bdev-args.m42
-rw-r--r--config/kernel-kobj-name-len.m42
-rw-r--r--config/kernel-xattr-handler.m46
-rwxr-xr-xconfigure60
10 files changed, 45 insertions, 45 deletions
diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
index ea69bdba5..ced486193 100644
--- a/config/kernel-bio-end-io-t-args.m4
+++ b/config/kernel-bio-end-io-t-args.m4
@@ -15,7 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
#include <linux/bio.h>
],[
void (*wanted_end_io)(struct bio *, int) = NULL;
- bio_end_io_t *local_end_io;
+ bio_end_io_t *local_end_io __attribute__ ((unused));
local_end_io = wanted_end_io;
],[
diff --git a/config/kernel-bio-failfast.m4 b/config/kernel-bio-failfast.m4
index c45175bdd..6b9a5269e 100644
--- a/config/kernel-bio-failfast.m4
+++ b/config/kernel-bio-failfast.m4
@@ -9,7 +9,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = (1 << BIO_RW_FAILFAST);
],[
AC_MSG_RESULT(yes)
@@ -25,7 +25,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST_DTD], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = ((1 << BIO_RW_FAILFAST_DEV) |
(1 << BIO_RW_FAILFAST_TRANSPORT) |
(1 << BIO_RW_FAILFAST_DRIVER));
@@ -43,7 +43,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_FAILFAST_MASK], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_FAILFAST_MASK;
],[
AC_MSG_RESULT(yes)
diff --git a/config/kernel-bio-rw-syncio.m4 b/config/kernel-bio-rw-syncio.m4
index 6f8b5b591..4bff80a8f 100644
--- a/config/kernel-bio-rw-syncio.m4
+++ b/config/kernel-bio-rw-syncio.m4
@@ -9,7 +9,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_SYNC], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNC;
],[
AC_MSG_RESULT(yes)
@@ -24,7 +24,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_SYNCIO], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNCIO;
],[
AC_MSG_RESULT(yes)
@@ -39,7 +39,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_SYNC], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/bio.h>
],[
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_SYNC;
],[
AC_MSG_RESULT(yes)
diff --git a/config/kernel-evict-inode.m4 b/config/kernel-evict-inode.m4
index 3cf5a3666..f748898c3 100644
--- a/config/kernel-evict-inode.m4
+++ b/config/kernel-evict-inode.m4
@@ -9,7 +9,7 @@ AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
#include <linux/fs.h>
],[
void (*evict_inode) (struct inode *) = NULL;
- struct super_operations sops;
+ struct super_operations sops __attribute__ ((unused));
sops.evict_inode = evict_inode;
],[
diff --git a/config/kernel-fmode-t.m4 b/config/kernel-fmode-t.m4
index cf25d8127..4a23c391d 100644
--- a/config/kernel-fmode-t.m4
+++ b/config/kernel-fmode-t.m4
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TYPE_FMODE_T],
ZFS_LINUX_TRY_COMPILE([
#include <linux/types.h>
],[
- fmode_t *ptr;
+ fmode_t *ptr __attribute__ ((unused));
],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FMODE_T, 1,
diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4
index 2733dba33..3f938426b 100644
--- a/config/kernel-fsync.m4
+++ b/config/kernel-fsync.m4
@@ -8,7 +8,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_2ARGS], [
#include <linux/fs.h>
],[
int (*fsync) (struct file *, int datasync) = NULL;
- struct file_operations fops;
+ struct file_operations fops __attribute__ ((unused));
fops.fsync = fsync;
],[
diff --git a/config/kernel-invalidate-bdev-args.m4 b/config/kernel-invalidate-bdev-args.m4
index c768f6275..09c2ebf26 100644
--- a/config/kernel-invalidate-bdev-args.m4
+++ b/config/kernel-invalidate-bdev-args.m4
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/buffer_head.h>
],[
- struct block_device *bdev;
+ struct block_device *bdev = NULL;
invalidate_bdev(bdev);
],[
AC_MSG_RESULT(yes)
diff --git a/config/kernel-kobj-name-len.m4 b/config/kernel-kobj-name-len.m4
index 5363a41ca..37999fabb 100644
--- a/config/kernel-kobj-name-len.m4
+++ b/config/kernel-kobj-name-len.m4
@@ -9,7 +9,7 @@ AC_DEFUN([ZFS_AC_KERNEL_KOBJ_NAME_LEN], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/kobject.h>
],[
- int val;
+ int val __attribute__ ((unused));
val = KOBJ_NAME_LEN;
],[
AC_MSG_RESULT([yes])
diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4
index 1ebe1f0d9..325c960df 100644
--- a/config/kernel-xattr-handler.m4
+++ b/config/kernel-xattr-handler.m4
@@ -19,7 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER],
&xattr_test_handler,
};
],[
- struct super_block sb;
+ struct super_block sb __attribute__ ((unused));
sb.s_xattr = xattr_handlers;
],[
@@ -43,7 +43,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
],[
int (*get)(struct dentry *dentry, const char *name,
void *buffer, size_t size, int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.get = get;
],[
@@ -68,7 +68,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
int (*set)(struct dentry *dentry, const char *name,
const void *buffer, size_t size, int flags,
int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.set = set;
],[
diff --git a/configure b/configure
index 88155541b..feffaae48 100755
--- a/configure
+++ b/configure
@@ -12372,7 +12372,7 @@ int
main (void)
{
- fmode_t *ptr;
+ fmode_t *ptr __attribute__ ((unused));
;
return 0;
@@ -12437,7 +12437,7 @@ int
main (void)
{
- int val;
+ int val __attribute__ ((unused));
val = KOBJ_NAME_LEN;
;
@@ -12583,7 +12583,7 @@ int
main (void)
{
- struct block_device *bdev;
+ struct block_device *bdev = NULL;
invalidate_bdev(bdev);
;
@@ -12782,7 +12782,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = (1 << BIO_RW_FAILFAST);
;
@@ -12848,7 +12848,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = ((1 << BIO_RW_FAILFAST_DEV) |
(1 << BIO_RW_FAILFAST_TRANSPORT) |
(1 << BIO_RW_FAILFAST_DRIVER));
@@ -12916,7 +12916,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_FAILFAST_MASK;
;
@@ -12985,7 +12985,7 @@ main (void)
{
void (*wanted_end_io)(struct bio *, int) = NULL;
- bio_end_io_t *local_end_io;
+ bio_end_io_t *local_end_io __attribute__ ((unused));
local_end_io = wanted_end_io;
@@ -13053,7 +13053,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNC;
;
@@ -13119,7 +13119,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNCIO;
;
@@ -13185,7 +13185,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_SYNC;
;
@@ -13994,7 +13994,7 @@ int
main (void)
{
- struct super_block sb;
+ struct super_block sb __attribute__ ((unused));
sb.s_xattr = xattr_handlers;
@@ -14063,7 +14063,7 @@ main (void)
int (*get)(struct dentry *dentry, const char *name,
void *buffer, size_t size, int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.get = get;
@@ -14133,7 +14133,7 @@ main (void)
int (*set)(struct dentry *dentry, const char *name,
const void *buffer, size_t size, int flags,
int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.set = set;
@@ -14201,7 +14201,7 @@ main (void)
{
int (*fsync) (struct file *, int datasync) = NULL;
- struct file_operations fops;
+ struct file_operations fops __attribute__ ((unused));
fops.fsync = fsync;
@@ -14269,7 +14269,7 @@ main (void)
{
void (*evict_inode) (struct inode *) = NULL;
- struct super_operations sops;
+ struct super_operations sops __attribute__ ((unused));
sops.evict_inode = evict_inode;
@@ -16417,7 +16417,7 @@ int
main (void)
{
- fmode_t *ptr;
+ fmode_t *ptr __attribute__ ((unused));
;
return 0;
@@ -16482,7 +16482,7 @@ int
main (void)
{
- int val;
+ int val __attribute__ ((unused));
val = KOBJ_NAME_LEN;
;
@@ -16628,7 +16628,7 @@ int
main (void)
{
- struct block_device *bdev;
+ struct block_device *bdev = NULL;
invalidate_bdev(bdev);
;
@@ -16827,7 +16827,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = (1 << BIO_RW_FAILFAST);
;
@@ -16893,7 +16893,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = ((1 << BIO_RW_FAILFAST_DEV) |
(1 << BIO_RW_FAILFAST_TRANSPORT) |
(1 << BIO_RW_FAILFAST_DRIVER));
@@ -16961,7 +16961,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_FAILFAST_MASK;
;
@@ -17030,7 +17030,7 @@ main (void)
{
void (*wanted_end_io)(struct bio *, int) = NULL;
- bio_end_io_t *local_end_io;
+ bio_end_io_t *local_end_io __attribute__ ((unused));
local_end_io = wanted_end_io;
@@ -17098,7 +17098,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNC;
;
@@ -17164,7 +17164,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = BIO_RW_SYNCIO;
;
@@ -17230,7 +17230,7 @@ int
main (void)
{
- int flags;
+ int flags __attribute__ ((unused));
flags = REQ_SYNC;
;
@@ -18039,7 +18039,7 @@ int
main (void)
{
- struct super_block sb;
+ struct super_block sb __attribute__ ((unused));
sb.s_xattr = xattr_handlers;
@@ -18108,7 +18108,7 @@ main (void)
int (*get)(struct dentry *dentry, const char *name,
void *buffer, size_t size, int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.get = get;
@@ -18178,7 +18178,7 @@ main (void)
int (*set)(struct dentry *dentry, const char *name,
const void *buffer, size_t size, int flags,
int handler_flags) = NULL;
- struct xattr_handler xops;
+ struct xattr_handler xops __attribute__ ((unused));
xops.set = set;
@@ -18246,7 +18246,7 @@ main (void)
{
int (*fsync) (struct file *, int datasync) = NULL;
- struct file_operations fops;
+ struct file_operations fops __attribute__ ((unused));
fops.fsync = fsync;
@@ -18314,7 +18314,7 @@ main (void)
{
void (*evict_inode) (struct inode *) = NULL;
- struct super_operations sops;
+ struct super_operations sops __attribute__ ((unused));
sops.evict_inode = evict_inode;